What is Redux Saga?

Redux Saga is a middleware library for Redux that provides an elegant way to handle side effects in your React applications. Side effects can include asynchronous actions like making API calls, managing WebSocket connections, and more.

Before we dive into the implementation details, let’s gain a basic understanding of Redux Saga.

Redux Saga is built on the concept of generators, a feature introduced in ES6. Generators are special functions that can be paused and resumed, making them perfect for handling asynchronous operations in a non-blocking manner. Redux Saga uses these generators to manage side effects in a declarative and testable way.

Redux workflow with a middleware:

Redux Workflow

Redux-Saga is a library that aims to make application side effects (i.e., asynchronous things like data fetching and impure things like accessing the browser cache) easier to manage, more efficient to execute, easy to test, and better at handling failures.

What is the use of middleware Redux Saga ?

Similar Reads

What is Redux Saga?

Redux Saga is a middleware library for Redux that provides an elegant way to handle side effects in your React applications. Side effects can include asynchronous actions like making API calls, managing WebSocket connections, and more....

Setting Up Redux Saga

Step 1: Create a React Application...

Project Structure

Now create a index.js file in a directory actions inside the src directory....