Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$derived exposed through property not necessarily updating #15248

Open
brunnerh opened this issue Feb 9, 2025 · 0 comments
Open

$derived exposed through property not necessarily updating #15248

brunnerh opened this issue Feb 9, 2025 · 0 comments

Comments

@brunnerh
Copy link
Member

brunnerh commented Feb 9, 2025

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

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

REPL

Severity

annoyance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant