Defining Saga

We are going to use the same endpoint to list users and search users. Searching users is similar to listing users with search queries. To list users, follow these steps:

  1. Define Saga. The Saga file is placed inside app/containers/User/saga.js. Here, we have only included the Saga code to create a user. The rest of the Saga code can be found inside CH06/app/containers/User/saga.js. It contains Saga for searching the user, removing a user, updating a user, creating a user, and checking a user's details:
import request from 'utils/request';import qs from 'query-string';import { notification } from 'antd';import { call, put, takeLatest } from 'redux-saga/effects';import {  USER_CREATE_REQUEST} from './constants';import { onCreateSuccess, ...

Get Redux Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.