📜  asynch action redux - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:46.527000             🧑  作者: Mango

代码示例1
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);
  }
};