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
When a mirrored value changes through a reactivity to another value, it doesn't trigger further reactivity on blocks that depend on it or components that indirectly depend on it.
Reproduction
<script>
let source = 0;
let mirror = 0;
$: isMirrorZero = mirror === 0;
// Changes on mirror doesn't trigger this block when it's changed by syncMirror.
$: {
const id = Math.floor(Math.random() * 100);
console.log(`${id}. source: ${source}; mirror: ${mirror}`)
setTimeout(() => {console.log(`${id}. mirror later: ${mirror}`)}, 1)
}
$: syncMirror(source);
function syncMirror(s) {
if (mirror !== s) {
mirror = s;
}
}
function handleClick() {
source++
}
</script>
<button on:click={handleClick}>
Source: {source}
</button>
<p>
Mirror: {mirror}
</p>
{#if isMirrorZero}
<p>
This should not appear when mirror is not zero
</p>
{/if}
Logs
No response
System Info
Repl
Severity
annoyance
The text was updated successfully, but these errors were encountered:
Describe the bug
When a mirrored value changes through a reactivity to another value, it doesn't trigger further reactivity on blocks that depend on it or components that indirectly depend on it.
Reproduction
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: