Skip to content

Commit

Permalink
fix: add warnings when the different namespaced modules has the same …
Browse files Browse the repository at this point in the history
…names… (#1554)

* add warnings when the different namespaced modules has the same namespace

* Add warnings when duplicate namespace for different namespaced modules

* Add warnings when duplicate namespace, merge if
  • Loading branch information
liyangworld authored and ktsn committed May 22, 2019
1 parent 7f0cdb2 commit 91f3e69
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,9 @@ function installModule (store, rootState, path, module, hot) {

// register in namespace map
if (module.namespaced) {
if (store._modulesNamespaceMap[namespace] && process.env.NODE_ENV !== 'production') {
console.error(`[vuex] duplicate namespace ${namespace} for the namespaced module ${path.join('/')}`)
}
store._modulesNamespaceMap[namespace] = module
}

Expand Down

0 comments on commit 91f3e69

Please sign in to comment.