Comment

Comment by matthieu-b

What I (personally) don't like about putting side-effects in action creators is that these functions become impure, hard to test and if there are many side effects they can get very messy. Although, for me the main reason would be that the logic is then spread across dozen of files (reducers, action creators, ...) and that's something I don't really like with redux.

With this declarative approach you have a really clear idea of what's happening in terms of both side effects and state just by looking at the reducer.

Once again, if you're happy with putting them in action creators, it's completely fine. It's a matter of taste I guess and you should probably use what you're the most comfortable with.

I took this idea from re-frame in clojurescript. When going back to JS and redux I thought I missed this approach, so I made this small thing.

parent matthieu-b 9 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton