(path, rawModule, options = {})
| 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] |
no test coverage detected