Hi I am not sure if the script tag is supposed to be in the markup to begin with
you can't defined more than one script tag per file, try something like this let amount = 50; $: if(amount===50) { amount=60 }
It is actually possible when its enclosed inside a logic block
Plus i actually want to change the state, not the code
Thanks, didn't know that, I will try it
It was actually surprised when i found out by running the random code above... But its not reactive, thats the drawback of the trick
Yes it works but the reactive part is a drawback
What is Cyclical Dependency in Svelte ?
It’s when multiple reactive variables have an infinite dependency cycle, like a->b->a. If you update a, you’ll trigger a never-ending recompute state.
Обсуждают сегодня