by superhawk610 · 6y ago · 0 comments
Most of it can be explained in a HN comment:
Component state just does its thing. You change it with = and the component is re-rendered.
Writable stores need to trigger changes with set() and you need to use $ whenever you reference it in a .svelte file so that Svelte handles subscription automatically.
Reactive statements $: are a bit more complex. Every variable inside those is referenced by the compiler so that it knows when you are mutating it. Either with = or if it's a writable store with set().