actionPromisesClear.js 370 B

123456789
  1. import { all, put } from "redux-saga/effects";
  2. import { actionPromiseClear } from "../reducers";
  3. export const actionPromisesClear = (promises = []) => ({ type: "PROMISES_CLEAR", payload: promises });
  4. export function* promisesClearWorker(action) {
  5. const promises = action.payload || [];
  6. yield all(promises.map((promise) => put(actionPromiseClear(promise))));
  7. }