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

Configure whether or not actionQueue should be executed #160

Closed
patrickngohonestbee opened this issue Feb 3, 2019 · 6 comments · Fixed by #225
Closed

Configure whether or not actionQueue should be executed #160

patrickngohonestbee opened this issue Feb 3, 2019 · 6 comments · Fixed by #225

Comments

@patrickngohonestbee
Copy link

patrickngohonestbee commented Feb 3, 2019

Hi,
Thanks for this awesome lib.
I'm curious if there is a way to condition if the actionQueue should be run or not after a CONNECTION_CHANGE?
For example this would be useful for checking for proper authentication, before running dispatching the actions.

Small proof of concept here:
patrickngohonestbee@8d64f6c

@hariDasu
Copy link

I have a similar issue,

I want to ensure a way of running my refreshTokenSaga() to ensure the user has a valid token before the queued offline actions are dispatched when network connectivity resumes.

I suppose I could unshift the refreshTokenSaga() to the offline Queue or simply add it as the first action as soon as the network goes offline.

Not sure if you are using token based auth for your API, @patrickngohonestbee , but maybe you can try something similar for your logic as well

@melvynhills
Copy link

Without such condition this library sadly becomes pretty useless in a real-world application.

I implemented @patrickngohonestbee's solution and it works well for my needs: gomymove@fa1b7ff

@MakhouT
Copy link

MakhouT commented Sep 30, 2019

I also need this functionality, I need to check if the token is still valid. Good point @patrickngohonestbee!

@emanueleDiVizio
Copy link
Contributor

Hey, we've encountered the same issue in our team and ended up writing a solution for this. We've opened a PR. It's still a MVP, so any feedback is appreciated. #225

@MakhouT
Copy link

MakhouT commented Oct 2, 2019

@emanueleDiVizio Cool! Thanks for sharing this. I think the best person to provide some feedback for this is @rgommezz
I think it would beneficial to add some docs.

@emanueleDiVizio
Copy link
Contributor

So update, we're working hard on #225 and it now has docs!

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

Successfully merging a pull request may close this issue.

6 participants