News for hackers. Stuff that matters.
Re:Common Beginner Mistakes with React by frodowtf on Sunday March 12, 2023 @03:17AM (#35117625)
Does svelte still have this thing where you need to reassign a variable to itself for updating?
Re:Common Beginner Mistakes with React by sk0g on Sunday March 12, 2023 @06:16AM (#35118456)
No? External changes to variables trigger reloads too, it was quite a nice experience coming from back end and hobby game dev.

Now, the reactive blocks, where an update to _any_ variable used in them trigger the re-evaluation seemed rife for abuse - particularly when the variables could be brought in from other files, but I forget the mechanics behind that.

I used it plenty of course. Forgot how it worked the day after I stopped working on the project though.

For example, this file https://github.com/sk0g/peripheral-emulator-web-app/blob/mas...

Edit: unless you mean lines like `ultrasonicDetectedDistance.update(v => v = distance)`, which yeah was an interesting quirk. Not enough of a pain to go with something like React, thought that wouldn't meet the latency requirements for this project. TBF neither did Svelte entirely, but it got close.

Re:Common Beginner Mistakes with React by myrryr on Sunday March 12, 2023 @06:42AM (#35118578)
Under very particular conditions, yes.

fewer conditions now than it used to be, but you still need to do this at times.

Usually I take it as a sign I should move to using a store.

Sveltekit is very good.