@solidjs/router 0.11.1 → 0.11.2
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/data/cache.js +5 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/data/cache.js
CHANGED
|
@@ -82,11 +82,14 @@ export function cache(fn, name, options) {
|
|
|
82
82
|
}
|
|
83
83
|
return res;
|
|
84
84
|
}
|
|
85
|
-
let res = !isServer && sharedConfig.context && sharedConfig.
|
|
85
|
+
let res = !isServer && sharedConfig.context && sharedConfig.has(key)
|
|
86
86
|
? sharedConfig.load(key) // hydrating
|
|
87
87
|
: fn(...args);
|
|
88
88
|
// serialize on server
|
|
89
|
-
if (isServer &&
|
|
89
|
+
if (isServer &&
|
|
90
|
+
sharedConfig.context &&
|
|
91
|
+
sharedConfig.context.async &&
|
|
92
|
+
!sharedConfig.context.noHydrate) {
|
|
90
93
|
const e = getRequestEvent();
|
|
91
94
|
(!e || !e.serverOnly) && sharedConfig.context.serialize(key, res);
|
|
92
95
|
}
|
package/dist/index.js
CHANGED
|
@@ -879,11 +879,11 @@ function cache(fn, name, options) {
|
|
|
879
879
|
}
|
|
880
880
|
return res;
|
|
881
881
|
}
|
|
882
|
-
let res = !isServer && sharedConfig.context && sharedConfig.
|
|
882
|
+
let res = !isServer && sharedConfig.context && sharedConfig.has(key) ? sharedConfig.load(key) // hydrating
|
|
883
883
|
: fn(...args);
|
|
884
884
|
|
|
885
885
|
// serialize on server
|
|
886
|
-
if (isServer && sharedConfig.context && !sharedConfig.context.noHydrate) {
|
|
886
|
+
if (isServer && sharedConfig.context && sharedConfig.context.async && !sharedConfig.context.noHydrate) {
|
|
887
887
|
const e = getRequestEvent();
|
|
888
888
|
(!e || !e.serverOnly) && sharedConfig.context.serialize(key, res);
|
|
889
889
|
}
|