...

/

Normalizing Responses

Normalizing Responses

Learn how to normalize the responses using the normalizr library.

We'll cover the following...

When we use the normalizr library in Redux, the API middleware can automatically apply the normalization on the received data:

import { normalize } from 'normalizr';

const {
  url,
  onSuccess,
  onFailure,
  method = 'GET',
  data,
  transformRequest,
  transformResponse,
  schema
} = action.payload;

const dataProperty = ['GET', 'DELETE'].includes(method) ? 'params' :
...