-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed as not planned
Description
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
<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
Metadata
Metadata
Assignees
Labels
No labels