|
|
|
|
|
by couchand
3156 days ago
|
|
I didn't understand the rationale of redux-loop, and I don't understand this one's either. Reducers are nice and simple, why go muddying them up with side-effects? There are already two good places to put side-effects in redux: action creators and middleware. What's the compelling reason that those aren't sufficient? |
|
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.