Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ilikerobots/ec589443ae9c0878b298949b567c500d to your computer and use it in GitHub Desktop.
Save ilikerobots/ec589443ae9c0878b298949b567c500d to your computer and use it in GitHub Desktop.
export const createSharedStore = (modules) => {
return new createStore({
plugins: [
createPersistedState({
paths: Object.entries(modules).map(
([mName , m]) => 'persistentPaths' in m
? m.persistentPaths.map(path => mName + "." + 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