-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Open
Description
Describe the bug
I tried to eliminate an $effect that writes a $derived value to a property by wrapping the derived access in a property. The $derived values appear to run initially but not when dependencies are updated.
Reproduction
- Version with
$effect - Version with wrapped
$derived
(Also made a version withoutSvelteMapto rule that out)
I tried to make a simpler reproduction from scratch but could not reproduce the issue that way.
Core diff in node.svelte code
- $effect.pre(() => result = derivedResult);
+ result = {
+ get current() { return derivedResult },
+ };
</script>
<div>
@@ -35,7 +37,7 @@
bind:content={content.children[i]}
bind:result={
() => undefined,
- v => childResultMap.set(child, v)
+ v => childResultMap.set(child, v.current)
}
/>
</li>Logs
System Info
REPLSeverity
annoyance
Metadata
Metadata
Assignees
Labels
No labels