6 ms·
After using Redux for a while, I realized that I was creating a lot of boilerplate to essentially (1) update an immutable store and (2) pass that store's state
by winton 8y ago
After using Redux for a while, I realized that I was creating a lot of boilerplate to essentially (1) update an immutable store and (2) pass that store's state to (a)sync callbacks that execute in serial before and after the store was updated.
This lead me to the creation of DotStore (https://github.com/invrs/dot-store#readme https://github.com/invrs/dot-store#readme), along with extensions to use it with React [1] and the filesystem [2].
"Dot prop" strings have proved to be an elegant solution to detect which props changed on the store. Usually this means doing a regex match in `shouldComponentUpdate`. We almost never use React's state anymore.
[1]: https://github.com/invrs/dot-store/tree/master/packages/dot-store-react#readme https://github.com/invrs/dot-store/tree/master/packages/dot-...
[2]: https://github.com/invrs/dot-store/tree/master/packages/dot-store-fs#readme https://github.com/invrs/dot-store/tree/master/packages/dot-...