Skip to content

Commit

Permalink
allow partially hot reload modules
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Mar 8, 2016
1 parent f07adca commit a85c19a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class Store {
}

/**
* Hot update actions and mutations.
* Hot update mutations & modules.
*
* @param {Object} options
* - {Object} [mutations]
Expand Down Expand Up @@ -163,13 +163,16 @@ class Store {
* Bind mutations for each module to its sub tree and
* merge them all into one final mutations map.
*
* @param {Object} modules
* @param {Object} updatedModules
*/

_setupModuleMutations (modules) {
this._modules = modules
_setupModuleMutations (updatedModules) {
const modules = this._modules
const { getPath } = Vue.parsers.path
const allMutations = [this._rootMutations]
Object.keys(updatedModules).forEach(key => {
modules[key] = updatedModules[key]
})
Object.keys(modules).forEach(key => {
const module = modules[key]
if (!module || !module.mutations) return
Expand Down

0 comments on commit a85c19a

Please sign in to comment.