MCPcopy
hub / github.com/vuejs/vuex / registerModule

Method registerModule

src/store.js:215–227  ·  view source on GitHub ↗
(path, rawModule, options = {})

Source from the content-addressed store, hash-verified

213 }
214
215 registerModule (path, rawModule, options = {}) {
216 if (typeof path === 'string') path = [path]
217
218 if (__DEV__) {
219 assert(Array.isArray(path), `module path must be a string or an Array.`)
220 assert(path.length > 0, 'cannot register the root module by using registerModule.')
221 }
222
223 this._modules.register(path, rawModule)
224 installModule(this, this.state, path, this._modules.get(path), options.preserveState)
225 // reset store to update getters...
226 resetStoreState(this, this.state)
227 }
228
229 unregisterModule (path) {
230 if (typeof path === 'string') path = [path]

Callers 3

index.tsFile · 0.80
modules.spec.jsFile · 0.80
store.spec.jsFile · 0.80

Calls 5

assertFunction · 0.90
installModuleFunction · 0.90
resetStoreStateFunction · 0.90
registerMethod · 0.80
getMethod · 0.80

Tested by

no test coverage detected