unistore
unistore copied to clipboard
Side effect in `store.setState`
Hi, I'm the creator of Reless-js (https://github.com/Alber70g/reless-js) which is basically the same thing as unistore.
I've used an update to update things in an async matter, but it's nicer to pass actions in the action and call one of them to update the state. Otherwise you'd have some sort of side-effect which is hard to locate and log with Dev Tools (e.g. redux-dev-tools).
Have a look at how I solved it in reless-js and use it to your advantage
Just my 2 cents ;)
The store doesn't know about actions, since they are not centrally registered.