@@ -43,7 +43,7 @@ class Store {
4343 initStoreVM ( this , state , { } )
4444
4545 // apply root module
46- this . module ( [ ] , options )
46+ this . registerModule ( [ ] , options )
4747
4848 // apply plugins
4949 plugins . concat ( devtoolPlugin ) . forEach ( plugin => plugin ( this ) )
@@ -63,7 +63,7 @@ class Store {
6363 this . _committing = false
6464 }
6565
66- module ( path , module , hot ) {
66+ registerModule ( path , module , hot ) {
6767 this . _committing = true
6868 if ( typeof path === 'string' ) path = [ path ]
6969 assert ( Array . isArray ( path ) , `module path must be a string or an Array.` )
@@ -75,15 +75,15 @@ class Store {
7575 this . _committing = false
7676 }
7777
78- mutation ( type , handler , path = [ ] ) {
78+ registerMutation ( type , handler , path = [ ] ) {
7979 const entry = this . _mutations [ type ] || ( this . _mutations [ type ] = [ ] )
8080 const store = this
8181 entry . push ( function wrappedMutationHandler ( payload ) {
8282 handler ( getNestedState ( store . state , path ) , payload )
8383 } )
8484 }
8585
86- action ( type , handler , path = [ ] ) {
86+ registerAction ( type , handler , path = [ ] ) {
8787 const entry = this . _actions [ type ] || ( this . _actions [ type ] = [ ] )
8888 const store = this
8989 const { dispatch, commit } = this
@@ -191,7 +191,7 @@ class Store {
191191 options . modules [ key ] = newOptions . modules [ key ]
192192 }
193193 }
194- this . module ( [ ] , options , true )
194+ this . registerModule ( [ ] , options , true )
195195 }
196196}
197197
@@ -259,13 +259,13 @@ function initModule (store, path, module, hot) {
259259
260260 if ( mutations ) {
261261 Object . keys ( mutations ) . forEach ( key => {
262- store . mutation ( key , mutations [ key ] , path )
262+ store . registerMutation ( key , mutations [ key ] , path )
263263 } )
264264 }
265265
266266 if ( actions ) {
267267 Object . keys ( actions ) . forEach ( key => {
268- store . action ( key , actions [ key ] , path )
268+ store . registerAction ( key , actions [ key ] , path )
269269 } )
270270 }
271271
0 commit comments