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

Question: Retry failed action in single flow #1383

Closed
tristangodfrey opened this issue Feb 10, 2016 · 2 comments
Closed

Question: Retry failed action in single flow #1383

tristangodfrey opened this issue Feb 10, 2016 · 2 comments

Comments

@tristangodfrey
Copy link

How would one implement the following flow?

Dispatch API action > API middleware executes request > Request fails (401, auth token needs to be refreshed) > Refresh auth token (refresh token action called from middleware) > Re-execute original action

Is it possible to do this all in the flow of a single action? I can post code if necessary, hope my question is clear enough.

@gaearon
Copy link
Contributor

gaearon commented Feb 10, 2016

I would say that I recommend https://github.com/yelouafi/redux-saga for async control flow like this.

@gaearon gaearon closed this as completed Feb 10, 2016
@tristangodfrey
Copy link
Author

Thanks @gaearon I'll check that out.

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