Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

processReturn plus processMultiple #154

Open
adambiltcliffe opened this issue Sep 23, 2019 · 0 comments
Open

processReturn plus processMultiple #154

adambiltcliffe opened this issue Sep 23, 2019 · 0 comments

Comments

@adambiltcliffe
Copy link

It's possible to set dispatchReturn to true explicitly but also accidentally enable dispatchMultiple implicitly by including the full signature of the process hook:

  processOptions: {
    dispatchReturn: true,
    successType: auth.actions.logout_success,
    failType: auth.actions.logout_failure
  },
  process({ getState, action, client }, dispatch, done) {
    return client.logout();
  }

This combination can only ever be an error (the logic cannot end), but redux-logic does not warn you about it until the warnTimeout is reached. It seems like it would be beneficial to log an error in development mode along the lines of "You should not include dispatch or done as arguments to process() if processOptions.dispatchReturn is set to true".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant