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

Running undo redo across multiple namespaced stores #82

Open
giesberge opened this issue Nov 15, 2021 · 0 comments
Open

Running undo redo across multiple namespaced stores #82

giesberge opened this issue Nov 15, 2021 · 0 comments

Comments

@giesberge
Copy link

giesberge commented Nov 15, 2021

So I'm not sure if this is possible but I have my store separated into multiple namespaces, for example like below if I have a "taskStore" with namespaced True. I'll eventually have other namespaced stores but I would like to maintain all of their history
together.

const mutations = {
  emptyState(state: State): void {
    state.taskStore.tasks = []
  },
}

const storeOptions: StoreOptions<State> = scaffoldStore({
  modules: {
    main: mainModule,
    taskStore: taskStoreModule,
  },
  plugins: [
    undoRedo({
      // The config object for each store module is defined in the 'paths' array
      paths: [
        {
          namespace: "main",
        },
        {
          namespace: "taskStore",
        }
      ],
    }),],
    mutations
});

But when I attempt to apply this I get errors like
[vuex] unknown mutation type: taskStore/updateCanUndoRedo js/webpack:/node_modules/vuex/dist/vuex.esm.js:460

Any thoughts?

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

1 participant