Skip to content
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

Does not work with nested persists? #5

Open
justduy opened this issue Nov 21, 2018 · 3 comments
Open

Does not work with nested persists? #5

justduy opened this issue Nov 21, 2018 · 3 comments

Comments

@justduy
Copy link

justduy commented Nov 21, 2018

Does not seem to work with nested persists, the tags state in TagsReducer still retains the data after 10 seconds.

import storageSession from "redux-persist/lib/storage/session";
import storageLocal from "redux-persist/lib/storage";
import autoMergeLevel2 from "redux-persist/lib/stateReconciler/autoMergeLevel2";
import { combineReducers } from "redux";
import { persistReducer } from "redux-persist";
import expireReducer from "redux-persist-expire";

import auth from "./authReducer";
import TagsReducer from "./api/tagsReducer";


const tagsStorePersistConfig = {
	key: "tagsStore",
	storage: storageLocal,
	stateReconciler: autoMergeLevel2,
	whitelist: ["tags"],
	transforms: [
		expireReducer("tags", {
			expireSeconds: 10,
			expiredState: []
		})
	]
};

const rootReducer = combineReducers({
	auth,
	tagsStore: persistReducer(tagsStorePersistConfig, TagsReducer)
});

export default rootReducer;
@BenBach
Copy link

BenBach commented May 30, 2019

@justduy Did you find a solution? Would appreciate any help

@justduy
Copy link
Author

justduy commented May 31, 2019

@BenBach could not find any solutions to this, have give up on making it work. You could clear the storage yourself programmatically by doing the check manually.

@maicolsantos
Copy link

Guys, I solved this error using autoExpire true and setting espiredState like my redux initial state

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants