How to handle asynchronous queuing in dva

    * deleteDetails({payload}, {call, put}) {
      const result = yield call(deleteDetails, {payload});
      if (result.code !== 200) {
        throw result.msg;
      } else {
        Toast.success(result.msg, 1);
        yield put(routerRedux.goBack())
      }
    },

execute the timing prompt first, and then return to the previous page after completing the prompt. How to deal with asynchronous queuing


is achieved through call a Promise :

   * deleteDetails({payload}, {call, put}) {
      const result = yield call(deleteDetails, {payload});
      if (result.code !== 200) {
        throw result.msg;
      } else {
          yield call(() => {
            return new Promise((resolve) => {
              Toast.success(result.msg, 1);
              setTimeout(() => resolve(), 1000)
            });
          });
          yield put(routerRedux.goBack())
      }
    }
Menu