@spoosh/plugin-invalidation 0.5.5 → 0.5.6
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/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -40,7 +40,7 @@ function resolveInvalidateTags(context, defaultMode) {
|
|
|
40
40
|
const pluginOptions = context.pluginOptions;
|
|
41
41
|
const invalidateOption = pluginOptions?.invalidate;
|
|
42
42
|
if (!invalidateOption) {
|
|
43
|
-
const overrideDefault = context.
|
|
43
|
+
const overrideDefault = context.temp.get(INVALIDATION_DEFAULT_KEY);
|
|
44
44
|
const effectiveDefault = overrideDefault ?? defaultMode;
|
|
45
45
|
return resolveModeTags(context, effectiveDefault);
|
|
46
46
|
}
|
|
@@ -73,7 +73,7 @@ function invalidationPlugin(config = {}) {
|
|
|
73
73
|
exports(context) {
|
|
74
74
|
return {
|
|
75
75
|
setDefaultMode(value) {
|
|
76
|
-
context.
|
|
76
|
+
context.temp.set(INVALIDATION_DEFAULT_KEY, value);
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
79
|
},
|
package/dist/index.mjs
CHANGED
|
@@ -14,7 +14,7 @@ function resolveInvalidateTags(context, defaultMode) {
|
|
|
14
14
|
const pluginOptions = context.pluginOptions;
|
|
15
15
|
const invalidateOption = pluginOptions?.invalidate;
|
|
16
16
|
if (!invalidateOption) {
|
|
17
|
-
const overrideDefault = context.
|
|
17
|
+
const overrideDefault = context.temp.get(INVALIDATION_DEFAULT_KEY);
|
|
18
18
|
const effectiveDefault = overrideDefault ?? defaultMode;
|
|
19
19
|
return resolveModeTags(context, effectiveDefault);
|
|
20
20
|
}
|
|
@@ -47,7 +47,7 @@ function invalidationPlugin(config = {}) {
|
|
|
47
47
|
exports(context) {
|
|
48
48
|
return {
|
|
49
49
|
setDefaultMode(value) {
|
|
50
|
-
context.
|
|
50
|
+
context.temp.set(INVALIDATION_DEFAULT_KEY, value);
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
53
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spoosh/plugin-invalidation",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.6",
|
|
4
4
|
"description": "Cache invalidation plugin for Spoosh - auto-invalidates after mutations",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@spoosh/core": ">=0.11.
|
|
36
|
+
"@spoosh/core": ">=0.11.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@spoosh/
|
|
40
|
-
"@spoosh/
|
|
39
|
+
"@spoosh/test-utils": "0.1.6",
|
|
40
|
+
"@spoosh/core": "0.11.1"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"dev": "tsup --watch",
|