[Vuejs]-Can namespaced modules handle mutations to the root namespace?

0👍

I’ve found my answer. I didn’t think to set up actions on the root namespace. E.g.

From non-namespaced context:

dispatch(APP_RESET)

In each of my modules:

[APP_RESET]: {
    root: true,
    handler ({commit}) {
        commit(RESET_MODULE_A)
    }
}

From namespaced context:

dispatch(APP_RESET)

In each of my modules:

['namespaceOfDispatcherModule/' + APP_RESET]: {
    root: true,
    handler ({commit}) {
        commit(RESET_MODULE_A)
    }
}

Leave a comment