You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found that I am using the following pattern frequently:
$effect(()=>{data;untrack(()=>{if(chart){chart.data=data;chart.option="some other derived runes";chart.update();}});});
So data is a derived rune and used as a signal to trigger the execution of code inside of untrack block.
Inside of the untrack, there might be other state or derived runes that I do not want to track and trigger the code.
Describe the proposed solution
I would like to see if this is possible to save me from typing some extra layers of brackets:
$effect.untrack((data)=>{if(chart){chart.data=data;chart.option="some other derived runes";chart.update();}});
If the above code does not follow Javascript syntax, would this be possible?
$effect.untrack(data,()=>{if(chart){chart.data=data;chart.option="some other derived runes";chart.update();}});
My goal here is to segregate signal runes and untracked code block to avoid typing an extra ( ) => { } block.
Can we put data into the input field, or multiple runes into the input field and use these input args as trigger signals to call the untrack block?
Importance
would make my life easier
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Describe the problem
I found that I am using the following pattern frequently:
So data is a derived rune and used as a signal to trigger the execution of code inside of untrack block.
Inside of the untrack, there might be other state or derived runes that I do not want to track and trigger the code.
Describe the proposed solution
I would like to see if this is possible to save me from typing some extra layers of brackets:
If the above code does not follow Javascript syntax, would this be possible?
My goal here is to segregate signal runes and untracked code block to avoid typing an extra
( ) => { }
block.Can we put data into the input field, or multiple runes into the input field and use these input args as trigger signals to call the untrack block?
Importance
would make my life easier
The text was updated successfully, but these errors were encountered: