Skip to content

Running undo redo across multiple namespaced stores #82

@giesberge

Description

@giesberge

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions