-
Notifications
You must be signed in to change notification settings - Fork 865
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
Async transforms #360
base: master
Are you sure you want to change the base?
Async transforms #360
Conversation
# Conflicts: # src/createPersistor.js
In my case I wanted to store secrets securely (say, in the keychain) and have them excluded from the persisted shape. Then, on rehydrate, I wanted to read the secrets from the keychain and apply them to the state as if they were there all along. |
@rt2zz any thoughts on this one? |
@rt2zz We have the exact same use case for this feature, this would be very nice to have in the package. |
@CharlieHess sorry for the delay on getting back here. I like the implementation but am concerned by the raw amount of code, and also the possible support burden. I have been working on redux-persist v5 lately and there might be an opportunity to make some more drastic changes there. Some options
Of course the challenge with option 2 is the variations are endless: some use cases might prefer to process the state before serialization, and other after. Some might require that the async process is blocking while others can run in parallel. Since this current solution is working for you I encourage you to keep using it for the time being (redux-persist@4 is not going to change much at all, so keeping up to date should not be difficult) while we take more time to think through how the api should work in v5. |
@rt2zz 👋 Just checking in - now that v5's out, what do you think would be the best approach for supporting async transforms now? |
any progress on this? |
Any news on this? We want to use it this way: maxdeviant/redux-persist-transform-encrypt#33 |
Guys I really need this, any progress on merging? |
We haven't needed to update to v5 yet and thus our fork (based off this branch) is still serving us for the time being. I won't be able to get back to this anytime soon but I bet Zack would consider a pull request! |
@rt2zz any progress here? I would love to see this supported. |
This PR resolves #303 by adding support for async transforms, behind a configuration flag (default behavior is unchanged). Folks with a well-defined use case can opt into this behavior at their own risk.