3 ms·
I find this a bit confusing, because stores are one of Svelte's answers to react's state, and React's state is a hot mess once you go beyond component-local sta
by pcthrowaway 3y ago
I find this a bit confusing, because stores are one of Svelte's answers to react's state, and React's state is a hot mess once you go beyond component-local state
- hbbio 3y agoReact state is a hot mess, yes! We kept the same interface as the Svelte store, but with different semantics: - special management of undefined values - error management - promise management
- bavell 3y agoCurious - what makes react state a mess? Is it just that there's not much batteries included?
- pcthrowaway 3y agoBriefly speaking, it's because the mechanisms for dealing with complex state structures which are either global, or shared between multiple components which are not direct ancestors/ descendents of one another, are really complicated, due to how changes within that state need to be managed and propagated through the component dependency graph. Spend an hour, a day, or a year (depending on how broad you want your "introduction" to this topic to be) reading the various blogs and docs on state management systems if you want to see how crazy this gets.