promiseRedicer.js 256 B

1234567891011
  1. function promiseReducer(state = {}, { type, status, payload, error, name }) {
  2. if (type === 'PROMISE') {
  3. return {
  4. ...state,
  5. [name]: { status, payload, error }
  6. }
  7. }
  8. return state;
  9. }
  10. //export promiseReducer;