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
This is basically imperative code, leading to the sort of bugs that trying to write vanilla JS leads to:
I'd refactor this to use await blocks and take advantage of the fact Svelte lets you declare constants inside them (which was the reason I initially wrote the code like that, because I didn't know you could do that)
It's treating "loading" and "has error?" as two unrelated parts of state but they could be easily coupled with promises. Leading to this:
I think I'd already fixed a similar bug by changing some if statement but the advantage of writing declarative code is that you don't have to think about every branch.
The text was updated successfully, but these errors were encountered:
This is basically imperative code, leading to the sort of bugs that trying to write vanilla JS leads to:
I'd refactor this to use await blocks and take advantage of the fact Svelte lets you declare constants inside them (which was the reason I initially wrote the code like that, because I didn't know you could do that)
It's treating "loading" and "has error?" as two unrelated parts of state but they could be easily coupled with promises. Leading to this:
I think I'd already fixed a similar bug by changing some if statement but the advantage of writing declarative code is that you don't have to think about every branch.
The text was updated successfully, but these errors were encountered: