Skip to content

Commit 9914bfc

Browse files
committed
fix(resource): use the setter value instead of the initial one
1 parent f1a7728 commit 9914bfc

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/small-coats-obey.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@solid-primitives/resource": patch
3+
---
4+
5+
Fix setter input value in `createDeepSignal`.

packages/resource/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,8 @@ export function createDeepSignal<T>(v?: T): Signal<T> {
298298
return [
299299
() => store[0],
300300
(update: T) => (
301-
setStore(0, reconcile(typeof update === "function" ? update(unwrap(store[0])) : v)), store[0]
301+
setStore(0, reconcile(typeof update === "function" ? update(unwrap(store[0])) : update)),
302+
store[0]
302303
),
303304
] as Signal<T>;
304305
}

0 commit comments

Comments
 (0)