FredericHeem / redux-act-async

Reduce boilerplate for redux async actions and reducers
Apache License 2.0
125 stars 22 forks source link

add options to provide callback for request, ok and error actions #9

Closed calvinnwq closed 8 years ago

calvinnwq commented 8 years ago

This allows including callbacks in actions.

const otherAction = createAction('OTHER_ACTION');
const options = {
  ok: {
    callback: (dispatch) => {
      dispatch(otherAction());
    },
  },
};
const request = createActionAsync('ACTION', apiOk, options);
FredericHeem commented 8 years ago

This PR doesn't merge properly, do you mind having a look ?