Use middleware to handle asyc help

Tell us what’s happening:

use middleware to handle asyc not passing… what am i missing out?

Your code so far

~~~
const REQUESTING_DATA = 'REQUESTING_DATA'
const RECEIVED_DATA = 'RECEIVED_DATA'

const requestingData = () => { return {type: REQUESTING_DATA} }
const receivedData = (data) => { return {type: RECEIVED_DATA, users: data.users} }

const handleAsync = () => {
return function(dispatch) {
  // dispatch request action here
dispatch(requestingData());

  setTimeout(function() {
    let data = {
      users: ['Jeff', 'William', 'Alice']
    }
    // dispatch received data action here
dispatch(receivedData());
  }, 2500);
}
};

const defaultState = {
fetching: false,
users: []
};

const asyncDataReducer = (state = defaultState, action) => {
switch(action.type) {
  case REQUESTING_DATA:
    return {
      fetching: true,
      users: []
    }
  case RECEIVED_DATA:
    return {
      fetching: false,
      users: action.users
    }
  default:
    return state;
}
};

const store = Redux.createStore(
asyncDataReducer,
Redux.applyMiddleware(ReduxThunk.default)
);

**Your browser information:**

User Agent is: <code>Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0</code>.

**Challenge:** Use Middleware to Handle Asynchronous Actions

**Link to the challenge:**
https://www.freecodecamp.org/learn/front-end-libraries/redux/use-middleware-to-handle-asynchronous-actions

@ADESHINESHINE you are not passing the required data to receivedData function (it takes in a data object)

const handleAsync = () => {
  return async (dispatch) => {
    // dispatch request action here
    dispatch(requestingData());

    setTimeout(function() {
      let data = {
        users: ['Jeff', 'William', 'Alice']
      }
      // dispatch received data action here
      dispatch(receivedData(data))
    }, 2500);
  }
};