react-redux-cache 0.9.0 → 0.10.0
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.
- package/README.md +1 -0
- package/dist/createCache.js +1 -1
- package/dist/index.js +1 -2
- package/dist/types.d.ts +3 -3
- package/dist/utilsAndConstants.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -165,6 +165,7 @@ export const {
|
|
|
165
165
|
query: getUser,
|
|
166
166
|
// For each query `secondsToLive` option can be set, which is used to set expiration date of a cached result when query response is received.
|
|
167
167
|
// After expiration query result is considered invalidated and will be refetched on the next useQuery mount.
|
|
168
|
+
// Can also be set globally in `globals`.
|
|
168
169
|
secondsToLive: 5 * 60 // Here cached result is valid for 5 minutes.
|
|
169
170
|
},
|
|
170
171
|
},
|
package/dist/createCache.js
CHANGED
|
@@ -30,7 +30,7 @@ const withTypenames = () => {
|
|
|
30
30
|
// provide all optional fields
|
|
31
31
|
(_a = partialCache.options) !== null && _a !== void 0 ? _a : (partialCache.options = {});
|
|
32
32
|
(_b = (_k = partialCache.options).logsEnabled) !== null && _b !== void 0 ? _b : (_k.logsEnabled = false);
|
|
33
|
-
(_c = (_l = partialCache.options).
|
|
33
|
+
(_c = (_l = partialCache.options).additionalValidation) !== null && _c !== void 0 ? _c : (_l.additionalValidation = utilsAndConstants_1.IS_DEV);
|
|
34
34
|
(_d = (_m = partialCache.options).deepComparisonEnabled) !== null && _d !== void 0 ? _d : (_m.deepComparisonEnabled = true);
|
|
35
35
|
(_e = partialCache.queries) !== null && _e !== void 0 ? _e : (partialCache.queries = {});
|
|
36
36
|
(_f = partialCache.mutations) !== null && _f !== void 0 ? _f : (partialCache.mutations = {});
|
package/dist/index.js
CHANGED
|
@@ -24,12 +24,11 @@ Object.defineProperty(exports, "defaultGetCacheKey", { enumerable: true, get: fu
|
|
|
24
24
|
Object.defineProperty(exports, "defaultQueryMutationState", { enumerable: true, get: function () { return utilsAndConstants_1.DEFAULT_QUERY_MUTATION_STATE; } });
|
|
25
25
|
// Backlog
|
|
26
26
|
// ! high (1.0.0)
|
|
27
|
-
// rca -> vite
|
|
28
|
-
// check validateFunctionArguments
|
|
29
27
|
// remove undefined optional fields & emtpy states. remove mutation state when it finished without errors
|
|
30
28
|
// remove cachePolicy? make skip/enabled a function? skip -> enabled/shouldFetch?
|
|
31
29
|
// generate full api docs
|
|
32
30
|
// ! medium
|
|
31
|
+
// example rca -> vite
|
|
33
32
|
// optimistic response
|
|
34
33
|
// reset [whole] cache to initial / to provided state
|
|
35
34
|
// globals for success, completions and loading states?
|
package/dist/types.d.ts
CHANGED
|
@@ -50,12 +50,12 @@ export type Globals<QP, MP> = {
|
|
|
50
50
|
};
|
|
51
51
|
export type CacheOptions = {
|
|
52
52
|
/**
|
|
53
|
-
* Enables validation
|
|
53
|
+
* Enables additional validation with logging to console.warn. Recommened to enable in dev/testing mode.
|
|
54
54
|
* @default true in dev mode.
|
|
55
55
|
* */
|
|
56
|
-
|
|
56
|
+
additionalValidation: boolean;
|
|
57
57
|
/**
|
|
58
|
-
* Enables
|
|
58
|
+
* Enables debug logs.
|
|
59
59
|
* @default false
|
|
60
60
|
*/
|
|
61
61
|
logsEnabled: boolean;
|
|
@@ -65,7 +65,7 @@ const applyEntityChanges = (entities, changes, options) => {
|
|
|
65
65
|
continue;
|
|
66
66
|
}
|
|
67
67
|
// check for key intersection
|
|
68
|
-
if (options.
|
|
68
|
+
if (options.additionalValidation) {
|
|
69
69
|
const mergeIds = entitiesToMerge && Object.keys(entitiesToMerge);
|
|
70
70
|
const replaceIds = entitiesToReplace && Object.keys(entitiesToReplace);
|
|
71
71
|
const idsSet = new Set(mergeIds);
|
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.
|
|
5
|
+
"version": "0.10.0",
|
|
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",
|