@@ -43,7 +43,7 @@ class Store {
43
43
initStoreVM ( this , state , { } )
44
44
45
45
// apply root module
46
- this . module ( [ ] , options )
46
+ this . registerModule ( [ ] , options )
47
47
48
48
// apply plugins
49
49
plugins . concat ( devtoolPlugin ) . forEach ( plugin => plugin ( this ) )
@@ -63,7 +63,7 @@ class Store {
63
63
this . _committing = false
64
64
}
65
65
66
- module ( path , module , hot ) {
66
+ registerModule ( path , module , hot ) {
67
67
this . _committing = true
68
68
if ( typeof path === 'string' ) path = [ path ]
69
69
assert ( Array . isArray ( path ) , `module path must be a string or an Array.` )
@@ -75,15 +75,15 @@ class Store {
75
75
this . _committing = false
76
76
}
77
77
78
- mutation ( type , handler , path = [ ] ) {
78
+ registerMutation ( type , handler , path = [ ] ) {
79
79
const entry = this . _mutations [ type ] || ( this . _mutations [ type ] = [ ] )
80
80
const store = this
81
81
entry . push ( function wrappedMutationHandler ( payload ) {
82
82
handler ( getNestedState ( store . state , path ) , payload )
83
83
} )
84
84
}
85
85
86
- action ( type , handler , path = [ ] ) {
86
+ registerAction ( type , handler , path = [ ] ) {
87
87
const entry = this . _actions [ type ] || ( this . _actions [ type ] = [ ] )
88
88
const store = this
89
89
const { dispatch, commit } = this
@@ -191,7 +191,7 @@ class Store {
191
191
options . modules [ key ] = newOptions . modules [ key ]
192
192
}
193
193
}
194
- this . module ( [ ] , options , true )
194
+ this . registerModule ( [ ] , options , true )
195
195
}
196
196
}
197
197
@@ -259,13 +259,13 @@ function initModule (store, path, module, hot) {
259
259
260
260
if ( mutations ) {
261
261
Object . keys ( mutations ) . forEach ( key => {
262
- store . mutation ( key , mutations [ key ] , path )
262
+ store . registerMutation ( key , mutations [ key ] , path )
263
263
} )
264
264
}
265
265
266
266
if ( actions ) {
267
267
Object . keys ( actions ) . forEach ( key => {
268
- store . action ( key , actions [ key ] , path )
268
+ store . registerAction ( key , actions [ key ] , path )
269
269
} )
270
270
}
271
271
0 commit comments