This document provides an overview of using Redux middleware for asynchronous actions, logging, analytics, and authentication. It demonstrates how to structure asynchronous action creators to work with Redux Thunk middleware and make API calls. It also shows how to build custom middleware to handle API requests, add authentication headers, and process responses. The document recommends middleware as a way to separate logic from components and encourages further reading on middleware patterns and the Redux ecosystem.
10. How long do actions take?
const benchmarkMiddleware = store => next => action => {
console.time(action.type);
next(action);
console.timeEnd(action.type);
};
> SET_USER: 0.645ms