unistore icon indicating copy to clipboard operation
unistore copied to clipboard

Side effect in `store.setState`

Open alber70g opened this issue 6 years ago • 1 comments

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 ;)

alber70g avatar Dec 08 '17 08:12 alber70g

The store doesn't know about actions, since they are not centrally registered.

developit avatar Dec 08 '17 16:12 developit