4 ms·
What does "do in action" mean? If you mean "make API call in reducer", that is commonly known to be an anti-pattern. Triggering the API call by dispatching acti
by nawitus 7y ago
What does "do in action" mean? If you mean "make API call in reducer", that is commonly known to be an anti-pattern. Triggering the API call by dispatching action, however, is a common pattern. Usually it's implemented with a library like redux-saga or redux-observable.
- pier25 7y agoI agree it's better if the implementation of, say, the API is not done in actions. Although I do not agree actions should be responsible for triggering application logic. It is a very popular pattern indeed, and I've used myself a number of times, but my code makes a lot more sense now that store(s) are only responsible for state management.