Answers for "asynch action redux"

0

asynch action redux

const handleAsync = () => {
  return function(dispatch) {
    dispatch(requestingData())

    setTimeout(function() {
      let data = {
        users: ['Jeff', 'William', 'Alice']
      }
      // Dispatch received data action here(just a placeholder for API)
      
        dispatch(receivedData(data))
    }, 2500);
  }
};
Posted by: Guest on May-25-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language