Yeah. I’ve been thinking about this pattern myself. If you want to compare notes, here’s my minimalistic store implementation here: github.com/zaydek/retro/blob/go-re....
I think useState is a nice primitive but telling devs to ‘lift state to the parent component’ is actually somewhat of an anti-pattern. I researched Svelte quite a bit and Vue both seem to implement stores, which seem to be largely the same kind of API you are showing off here, if I’m not mistaken.
Thanks for sharing!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Yeah. I’ve been thinking about this pattern myself. If you want to compare notes, here’s my minimalistic store implementation here: github.com/zaydek/retro/blob/go-re....
I think useState is a nice primitive but telling devs to ‘lift state to the parent component’ is actually somewhat of an anti-pattern. I researched Svelte quite a bit and Vue both seem to implement stores, which seem to be largely the same kind of API you are showing off here, if I’m not mistaken.
Thanks for sharing!