endograph/redux-persist ? reverse-engineered prompt
Reverse engineered prompt
Build me a TypeScript library that lets a Redux app save its state to storage and load it back when the app starts.
I want the main flow to be really simple, where I can wrap my root reducer, create a persistor, and optionally use a React component that waits until rehydration is done before rendering the app. It should work with web storage out of the box, but also let me plug in other storage like React Native async storage or other custom backends. Please include a way to choose which parts of state get saved, support nested persisted reducers, and handle state migrations when the stored shape changes. It should also work nicely with Redux Toolkit and not need extra setup for a normal app. If you need to check current docs or patterns online, go ahead. Please make sure the types are solid and the example usage is easy to follow.
Are you gonna build this?
make sure you review the code using coderabbit