Skip to content

Commit

Permalink
fix #2236 improper shortcircuit in resource hydration
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansolid committed Aug 8, 2024
1 parent c8fe58e commit 80dd276
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/hip-pumas-smile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"solid-js": patch
---

fix #2236 improper shortcircuit in resource hydration
2 changes: 1 addition & 1 deletion packages/solid/src/reactive/signal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ export function createResource<T, S, R>(
id = sharedConfig.getNextContextId();
let v;
if (options.ssrLoadFrom === "initial") initP = options.initialValue as T;
else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v;
else if (sharedConfig.load && sharedConfig.has!(id)) initP = sharedConfig.load(id);
}
function loadEnd(p: Promise<T> | null, v: T | undefined, error?: any, key?: S) {
if (pr === p) {
Expand Down

0 comments on commit 80dd276

Please sign in to comment.