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

Using in reducer #18

Closed
stephane-r opened this issue Mar 6, 2019 · 2 comments
Closed

Using in reducer #18

stephane-r opened this issue Mar 6, 2019 · 2 comments

Comments

@stephane-r
Copy link

Hello Daniel !

Is it possible to use your module from reducer switch ? For example :

const apiMiddleware = store => next => action => {
  next(action);

  switch (action.type) {
    case LOGIN_THROUGH_API:
      console.log('callApi ...');
      // Push to new route
      break;
  }
};

Thank you 💪

@danielr18
Copy link
Owner

It should be possible, you could dispatch a navigation action in the middleware.

You might find this useful: https://stackoverflow.com/questions/51186205/how-to-dispatch-actions-from-redux-middleware-in-correct-order

@danielr18
Copy link
Owner

Closed due to inactivity.

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

2 participants