I was learning svelte by reading the interactive tutorial from start to finish. When I got to the readable store part, having used redux, I immediately think:
Nice, I can use writable stores as mini redux stores.
The answer is yes, and that's a HUGE deal, because you can't do it in redux, and that has been drilled to people's heads.
In the current tutorial here and here, the example store is an integer:
export const count = writable(0);
And my initial assumption was "I probably can't do mutate in a store, otherwise the doc wouldn't have used an integer to demo it". Many many others may think like me - being able to mutate feels too good to be true.
So, I suggest adding a demo of an object as writable store. You have no idea how much redux has changed people brain.
(side note: even chatGPT is affected by redux, try asking I have a svelte writable store that is an object, how do I update a slice of it? and see what it says)
I was learning svelte by reading the interactive tutorial from start to finish. When I got to the readable store part, having used redux, I immediately think:
The answer is yes, and that's a HUGE deal, because you can't do it in redux, and that has been drilled to people's heads.
In the current tutorial here and here, the example store is an integer:
And my initial assumption was "I probably can't do mutate in a store, otherwise the doc wouldn't have used an integer to demo it". Many many others may think like me - being able to mutate feels too good to be true.
So, I suggest adding a demo of an object as writable store. You have no idea how much redux has changed people brain.
(side note: even chatGPT is affected by redux, try asking
I have a svelte writable store that is an object, how do I update a slice of it?
and see what it says)