So yes, and no.
Here is the same example reimplemented in svelte:
Right now it is working - you update searchTerm, page set to 0, data is loaded.
But once you move $: if ([searchTerm]) { below $: if ([page, searchTerm]) { it would not - you update searchTerm, data is loaded, page set to 0.
So Svelte is sensitive to the order of events, while react hooks are not.
It's not bad or good - it's different.
So yes, and no.
Here is the same example reimplemented in svelte:
Right now it is working - you update searchTerm, page set to 0, data is loaded.
But once you move
$: if ([searchTerm]) {
below$: if ([page, searchTerm]) {
it would not - you update searchTerm, data is loaded, page set to 0.So Svelte is sensitive to the order of events, while react hooks are not.
It's not bad or good - it's different.
Thanks a lot!