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
The reactive operator $: is invoked on text input when a store variable (but not local variable) and an assignment to the bound variable are present. This means that I can't just change a local variable to a store variable as part of the refactoring because that will break my code.
Reproduction
App.svelte:
<script>
import {modal} from './store.js'
let name = ''
$: if ($modal.opened) {
name = 'test'
console.log('invoked')
}
</script>
<input bind:value={name}>
Describe the bug
The reactive operator
$:
is invoked on text input when a store variable (but not local variable) and an assignment to the bound variable are present. This means that I can't just change a local variable to a store variable as part of the refactoring because that will break my code.Reproduction
App.svelte:
store.js:
REPL: https://svelte.dev/repl/624e932ca8d74649a0c8f3a0a65c2c49?version=3.49.0
Steps to reproduce
Expected result
console.log('invoked')
is not invokedActual result
console.log('invoked')
is invoked on every typeBut ...
But in the next two examples
console.log('invoked')
is not invoked.Example 1
App.svelte:
REPL: https://svelte.dev/repl/4dc52fa5e027438c9e744fd347789d36?version=3.49.0
Example 2
App.svelte:
REPL: https://svelte.dev/repl/0aa66028eb924709bf4a1d402931fd3c?version=3.49.0
Logs
No response
System Info
REPL from svelte.dev
Severity
annoyance
The text was updated successfully, but these errors were encountered: