React Redux tutorials for beginners-4

Middleware

  • It is the suggested way to extend Redux with custom functionality.
  • It provides a third party point between dispatching an action and the moment it reaches the reducer.
  • We can use middleware for logging, crash reporting, performing asynchronous tasks, etc.
Redux logger
redux-logger
middleware
redux-logger
redux logs

Async Actions

asyncActions.js
action creators
reducer
store
npm install --save axios redux-thunk
npm install
thunk middleware
Success
error

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store