react-redux-cache 0.0.7 → 0.0.8

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.
@@ -62,7 +62,7 @@ export declare const createCache: <T extends Typenames, QP, QR, MP, MR>(cache: O
62
62
  query: <QK_1 extends keyof QP | keyof QR>(options: QueryOptions<T, QP, QR, MP, MR, QK_1>) => Promise<void | import("./types").QueryResult<QK_1 extends infer T_1 ? T_1 extends QK_1 ? T_1 extends keyof QP & keyof QR ? QR[T_1] : never : never : never>>;
63
63
  };
64
64
  /** Fetches query when params change and subscribes to query state. */
65
- useQuery: <QK_2 extends keyof QP | keyof QR>(options: import("./types").UseQueryOptions<T, QP, QR, MP, MR, QK_2>) => readonly [import("./types").QueryMutationState<QR[keyof QR]>, () => Promise<void | import("./types").QueryResult<QK_2 extends infer T_2 ? T_2 extends QK_2 ? T_2 extends keyof QP & keyof QR ? QR[T_2] : never : never : never>>];
65
+ useQuery: <QK_2 extends keyof QP | keyof QR>(options: import("./types").UseQueryOptions<T, QP, QR, MP, MR, QK_2>) => readonly [import("./types").QueryMutationState<QK_2 extends keyof QP & keyof QR ? QR[QK_2] : never>, () => Promise<void | import("./types").QueryResult<QK_2 extends infer T_2 ? T_2 extends QK_2 ? T_2 extends keyof QP & keyof QR ? QR[T_2] : never : never : never>>];
66
66
  /** Subscribes to provided mutation state and provides mutate function. */
67
67
  useMutation: <MK_1 extends keyof MP | keyof MR>(options: {
68
68
  /**
@@ -5,4 +5,4 @@ export declare const defaultQueryCacheOptions: {
5
5
  readonly cacheQueryState: true;
6
6
  readonly cacheEntities: true;
7
7
  };
8
- export declare const useQuery: <T extends Typenames, QP, QR, MP, MR, QK extends keyof QP | keyof QR>(cache: Cache<T, QP, QR, MP, MR>, options: UseQueryOptions<T, QP, QR, MP, MR, QK>) => readonly [QueryMutationState<QR[keyof QR]>, () => Promise<void | import("./types").QueryResult<QK extends infer T_1 ? T_1 extends QK ? T_1 extends keyof QP & keyof QR ? QR[T_1] : never : never : never>>];
8
+ export declare const useQuery: <T extends Typenames, QP, QR, MP, MR, QK extends keyof QP | keyof QR>(cache: Cache<T, QP, QR, MP, MR>, options: UseQueryOptions<T, QP, QR, MP, MR, QK>) => readonly [QueryMutationState<QK extends keyof QP & keyof QR ? QR[QK] : never>, () => Promise<void | import("./types").QueryResult<QK extends infer T_1 ? T_1 extends QK ? T_1 extends keyof QP & keyof QR ? QR[T_1] : never : never : never>>];
package/dist/useQuery.js CHANGED
@@ -72,7 +72,7 @@ const useQuery = (cache, options) => {
72
72
  }, [cacheKey, paramsKey, cacheOptionsKey]); // TODO put args to ref and make empty deps?
73
73
  const queryStateFromSelector = (_c = (0, react_redux_1.useSelector)((state) => {
74
74
  const queryState = cacheStateSelector(state).queries[queryKey][cacheKey];
75
- return queryState;
75
+ return queryState; // TODO proper type
76
76
  })) !== null && _c !== void 0 ? _c : utilsAndConstants_1.defaultQueryMutationState;
77
77
  const queryState = hasResultFromSelector
78
78
  ? (Object.assign(Object.assign({}, queryStateFromSelector), { result: resultFromSelector }))
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.0.7",
5
+ "version": "0.0.8",
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",