CODEX
React-Redux for the Uninitiated (feat. Redux-Saga) — Part 3
Part 1: https://medium.com/codex/react-redux-for-the-uninitiated-feat-redux-saga-part-1-8cff10003e00
Part 2: https://medium.com/codex/react-redux-for-the-uninitiated-feat-redux-saga-part-2-2a747c74ba91
I’ve added a repo for the source material of this series, check it out here: https://github.com/zhifez/react-redux-for-the-uninitiated
When do you use Saga?
For me, it was when I have to handle the data returned from an API, and pushing them into the Reducer.
If you remember how Reducer works:
1. An Action is first triggered by Redux dispatch. The Action usually comes in the form of an object that has a type and one or more optional parameters.
2. A Reducer then intercepts the type value, and provide a response — updating the states with whatever parameter that’s being passed in along with the action object.