react-redux-cache 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -107,7 +107,7 @@ export declare const createCache: <N extends string, T extends Typenames, QP, QR
107
107
  /** Selects mutation latest error. */
108
108
  selectMutationError: <MK_4 extends keyof MP | keyof MR>(state: unknown, mutation: MK_4) => Error | undefined;
109
109
  /** Selects entity by id and typename. */
110
- selectEntityById: <TN extends keyof T>(state: unknown, id: Key | null | undefined, typename: TN) => void;
110
+ selectEntityById: <TN extends keyof T>(state: unknown, id: Key | null | undefined, typename: TN) => T[TN] | undefined;
111
111
  /** Selects all entities. */
112
112
  selectEntities: (state: unknown) => import("./types").EntitiesMap<T>;
113
113
  /** Selects all entities of provided typename. */
@@ -78,7 +78,7 @@ const createCache = (partialCache) => {
78
78
  },
79
79
  /** Selects entity by id and typename. */
80
80
  selectEntityById: (state, id, typename) => {
81
- id == null ? undefined : cache.cacheStateSelector(state).entities[typename][id];
81
+ return id == null ? undefined : cache.cacheStateSelector(state).entities[typename][id];
82
82
  },
83
83
  /** Selects all entities. */
84
84
  selectEntities: (state) => {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "react-redux-cache",
3
3
  "author": "Alexander Danilov",
4
4
  "license": "MIT",
5
- "version": "0.4.0",
5
+ "version": "0.4.1",
6
6
  "description": "Powerful data fetching and caching library that supports normalization, built on top of redux",
7
7
  "main": "dist/index.js",
8
8
  "types": "dist/index.d.ts",