-
Notifications
You must be signed in to change notification settings - Fork 864
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
(persistStore): add timeout option #702
Conversation
Re:
|
👍 ok I think I agree, lets add this and default the timeout. I still want to evaluate if timeout would better live in persistReducer or here (persistStore). Will look to merge this is something comparable this week. |
I like in persistReducer, since other config goes in there as well. However, I think it would be handy to pass the persist status to the persistStore callback (i.e. error or success), that way we can handle timeout cases. I like a default time, because if it's taking too long, something is likely wrong and the dev should know about it. |
Any Updates on this? |
this landed via #713 - applied to persistReducer instead of persistStore 👍 |
I see, thank you. |
yes the data will be lost if timeout is ever reached |
Hmm but is that really the better alternative ? I mean for my use case I would rather have the user restart the app if it doesn't render than losing all the data and continuing... Can we avoid this new logic by e.g. setting the timeout to -1 in the config or should I just pass a large number in there ? |
if timeout is exceeded, rehydrate will complete with an error. In the past it would simply hang indefinitely.
timeout is default undefined -> meaning no effect.
questions: