@solidjs/router 0.12.2 → 0.12.4
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/action.js +2 -4
- package/dist/data/cache.js +2 -2
- package/dist/index.js +3 -6
- package/package.json +1 -1
package/dist/data/action.js
CHANGED
|
@@ -59,13 +59,11 @@ export function action(fn, name) {
|
|
|
59
59
|
retry() {
|
|
60
60
|
setResult(undefined);
|
|
61
61
|
const p = fn(...variables);
|
|
62
|
-
p.then(handler, handler);
|
|
63
|
-
return p;
|
|
62
|
+
return p.then(handler, handler);
|
|
64
63
|
}
|
|
65
64
|
})
|
|
66
65
|
]);
|
|
67
|
-
p.then(handler, handler);
|
|
68
|
-
return p;
|
|
66
|
+
return p.then(handler, handler);
|
|
69
67
|
}
|
|
70
68
|
const url = fn.url ||
|
|
71
69
|
(name && `https://action/${name}`) ||
|
package/dist/data/cache.js
CHANGED
|
@@ -113,8 +113,8 @@ export function cache(fn, name) {
|
|
|
113
113
|
}
|
|
114
114
|
if (isServer) {
|
|
115
115
|
const e = getRequestEvent();
|
|
116
|
-
e && e.router.dataOnly
|
|
117
|
-
|
|
116
|
+
if (e && e.router.dataOnly)
|
|
117
|
+
return (e.router.data[key] = res);
|
|
118
118
|
}
|
|
119
119
|
if (intent !== "preload") {
|
|
120
120
|
res =
|
package/dist/index.js
CHANGED
|
@@ -945,8 +945,7 @@ function cache(fn, name) {
|
|
|
945
945
|
}
|
|
946
946
|
if (isServer) {
|
|
947
947
|
const e = getRequestEvent();
|
|
948
|
-
e && e.router.dataOnly
|
|
949
|
-
return res;
|
|
948
|
+
if (e && e.router.dataOnly) return e.router.data[key] = res;
|
|
950
949
|
}
|
|
951
950
|
if (intent !== "preload") {
|
|
952
951
|
res = "then" in res ? res.then(handleResponse(false), handleResponse(true)) : handleResponse(false)(res);
|
|
@@ -1076,12 +1075,10 @@ function action(fn, name) {
|
|
|
1076
1075
|
retry() {
|
|
1077
1076
|
setResult(undefined);
|
|
1078
1077
|
const p = fn(...variables);
|
|
1079
|
-
p.then(handler, handler);
|
|
1080
|
-
return p;
|
|
1078
|
+
return p.then(handler, handler);
|
|
1081
1079
|
}
|
|
1082
1080
|
}]);
|
|
1083
|
-
p.then(handler, handler);
|
|
1084
|
-
return p;
|
|
1081
|
+
return p.then(handler, handler);
|
|
1085
1082
|
}
|
|
1086
1083
|
const url = fn.url || name && `https://action/${name}` || (!isServer ? `https://action/${hashString(fn.toString())}` : "");
|
|
1087
1084
|
return toAction(mutate, url);
|