redux-persist
redux-persist copied to clipboard
type-safe persistStore()
After this patch, we can persistStore(store)
without any type errors when using store: Store<RootState, RootAction>
.
Here is my usage scenario:
import React, { StatelessComponent } from "react";
import { Provider } from "react-redux";
import { Route } from "react-router-dom";
import { Store } from "redux";
import { persistStore } from "redux-persist";
import { PersistGate } from "redux-persist/integration/react";
import { Router } from "./Router";
import { RootState, RootAction } from "./store";
interface Props {
store: Store<RootState, RootAction>;
app: StatelessComponent;
}
export const Root: StatelessComponent<Props> = ({ store, app }) => (
<Provider store={store}>
<PersistGate persistor={persistStore(store)}>
<Router>
<Route path="/:path?" component={app} />
</Router>
</PersistGate>
</Provider>
);
Someone knows what happen with the PR's in this repo?
Kindly merge this Branch. This PR can solve type error related to store.
Hey guys, when are u merging this?
up
I think ive solved it just adding "PersistPartial" type in the createStore function:
const store = createStore<IRootState & PersistPartial, any, any, any>( persistedReducer );
Hope it helps somebody
Hi there, this looks like a decent solution to me! Thank you very much, just patched it in my project 🙏 Do you guys think it can be merged?
This looks like it could fix my problem. Is this gonna get merged?
Hello, any update for this PR? Seems like a solution for type error issue related to store.
Hello ! I patched it into my project and it works :) Could you merge it?
@rt2zz Is it possible to merge this in please?
@sunnylqm Is there any reason it cannot be merged yet?
Why cannot be merge???
I do not have the permission. I made an approval to try to remind those who have permissions to merge. (Yes, anyone can approve)
Thanks for the message @sunnylqm . I guess the question should be directed rather to @rt2zz then.
@rt2zz why cannot be merge?
can we merge? :)
@rt2zz please merge, I need this as well 🙏
any update on when it will be merged?
Is there any news on the merge of this PR, would be very much appreciated.
waiting over a year for this to get merged, this is kind of ridiculous
It's still not merged?
Kindly merge this and include it in a new release as soon as possible.
@arzyu :)
I don’t have permission to merge code, hope the maintainer will continue to be active.
I love it! Thank you so much! It's the only source where I could've found this.
please merge this
has conflicts @arzyu are you able to resolve?