-
Notifications
You must be signed in to change notification settings - Fork 862
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
rehydrateAction is gone #65
Comments
What do you currently use rehydrateAction for? The recommendation is currently to do any custom rehydration processing in your reducer, or if you need to do async validation in a saga. It was removed because in an attempt to keep the overall api and complexity limited. If you have a use case that cannot be satisfactorily handled elsewise, I would be happy to readd support. |
also fwiw in the short term you should probably stick to 1.5.3 until we have time to think over how this fits into 2.0 |
The use case that came to mind was triggering a refresh of an authentication token if the prior had expired. |
I did end up just keeping our dependency at 1.5.3. The addition of the I'm rather unfamiliar with how sagas work (or what they are, in this context), but I'll do some digging. It's clear that some rearranging needs to be done. |
Ah, ok refreshing/expiring auth tokens is exactly why I added rehydrateAction in the first place! Since then however we changed how we handle auth tokens. My recommendation is you do auth token validation in the persistStore callback: persistStore(store, config, (err, state) => {
if(state.auth.token) processToken(state.auth.token)
}) Thoughts? |
That makes sense to me. I'm thinking I'm going to pull the whole auth flow out into a middleware, actually. There I can schedule the next token refresh and so on in a reasonable manner. Thanks for all your help! |
It seems that the provision for a custom actionCreator has been removed at some point since v1.5.3 and v2.0.1. Is there an alternative recommendation for handing the data to be rehydrated to an action creator upon rehydration?
The text was updated successfully, but these errors were encountered: