3 ms·
> With Redux, you are encouraged to do a lot of the app heavy-lifting in action creators. I've seen/learned quite the opposite: do as much of the heavy lifting
by namuol 9y ago
> With Redux, you are encouraged to do a lot of the app heavy-lifting in action creators.
I've seen/learned quite the opposite: do as much of the heavy lifting in your _reducers_ as possible.
Lighter actions (that more closely reflect the _cause_ of a change in your app -- not the change itself) tend to lead to less-tangled code.
- davidjnelson 9y agoThere seems to be some big downsides to intermingling side effects in action creators vs immutable state changes in reducers. Reducer logic would then require complex mocks. Reasoning about side effects and immutable state changes separately feels natural to me. Would love to hear how putting the side effects in the same functions used for immutable state changes makes code _less_ tangled.
- actsasbuffoon 9y agoAnother possibility is using sagas for handling side-effects. I've been happy with that approach. https://github.com/redux-saga/redux-saga https://github.com/redux-saga/redux-saga