Writing
Blog
Writing on system design, React, web performance, and the craft of building software.
Blog
State Management
Redux Saga
Expand All
1
Chapter 1: Generator Functions
2 articles
•
Not started
Javascript Generator Functions
Part 1
•
4 min read
•
Every Redux Saga handler is a generator function. Understanding how pause-and-resume works in JavaScript is the prerequisite that makes Saga code actually readable.
What Is Redux Saga
Part 2
•
3 min read
•
Redux Saga is middleware that sits between dispatch and the reducer, handling all server interactions before a plain action ever reaches the reducer.
2
Chapter 2: Saga Setup
2 articles
•
Not started
Installing Redux Saga
Part 1
•
2 min read
•
Three steps to add Redux Saga to a React-Redux app: install the package, create the middleware instance, and add it to applyMiddleware. Nothing runs until saga.run() is called.
Root Saga
Part 2
•
3 min read
•
The root saga runs at startup via saga.run() and routes dispatched actions to worker sagas. It must be a generator function called after createStore().
3
Chapter 3: Worker Sagas
2 articles
•
Not started
Worker Saga
Part 1
•
3 min read
•
Worker sagas are generator functions that handle specific action types. takeEvery maps an action type to a worker, which runs on every matching dispatch.
Saga Http Requests
Part 2
•
3 min read
•
In a worker saga, yield replaces await and put replaces dispatch. Use both to implement the pending/fulfilled/rejected HTTP pattern.
Redux Saga | Writing & Engineering | Durgesh Rai