Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save duaneking/d82c96658084ec4d761e1306d021e1ad to your computer and use it in GitHub Desktop.
Save duaneking/d82c96658084ec4d761e1306d021e1ad to your computer and use it in GitHub Desktop.
update paths used
export const createSharedStore = (modules) => {
return new createStore(
{
plugins: [
createPersistedState(
{
paths: Object.entries(modules).map(
(
[
moduleName,
module
]
) => 'persistentPaths' in module ? module.persistentPaths.map(path => moduleName + "." + path) : []
).flat(),
}
)
],
modules: modules,
strict: process.env.NODE_ENV !== "production",
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment