Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return (state: {}, action: any) => {
if (action.type === STORAGE && keys.includes(action.payload)) {
if (bindAllTabs && localStorage) {
const rehydratedState = rehydrateApplicationState([action.payload], localStorage, k => k, true);
return { ...state, ...rehydratedState };
}
return state;
}
return localStorageSync({
keys,
rehydrate: true,
restoreDates: true,
})(reducer)(state, action);
};
}