Basics

Learn the basics of using Middleware API.

We'll cover the following...

We can now take the previous example and encode the differences in the action’s payload. We initially had the following:

const fetchUser = id => dispatch =>
  axios.get(`http://api.ourserver.com/user/${id}`)
    .then(({ data: userData }) => dispatch(setUserData(userData)));

const fetchComments = id => dispatch =>
 
...