Interesting, my memory of reading about the Svelte magic reactivity was that it was pretty well explained that the only things 'reactive' would be things which were assigned to in the reactive statement.
So if you want to update y on some changes to x, you do
$: y = x
And if you need something more complicated, a transformation perhaps, you put the logic in a function and assign y to the result of that
the inconsistency comes from the fact that this reactivity, triggered from inside a function, is not taken into account to build the dependency graph and ultimately decide in which order to process the statements
So if you want to update y on some changes to x, you do
And if you need something more complicated, a transformation perhaps, you put the logic in a function and assign y to the result of that