@@ -30,8 +30,8 @@ class Store {
3030 this . dispatch = function boundDispatch ( type , payload ) {
3131 return dispatch . call ( store , type , payload )
3232 }
33- this . commit = function boundCommit ( type , payload ) {
34- return commit . call ( store , type , payload )
33+ this . commit = function boundCommit ( type , payload , options ) {
34+ return commit . call ( store , type , payload , options )
3535 }
3636
3737 // strict mode
@@ -58,10 +58,11 @@ class Store {
5858 assert ( false , `Use store.replaceState() to explicit replace store state.` )
5959 }
6060
61- commit ( type , payload ) {
61+ commit ( type , payload , options ) {
6262 // check object-style commit
6363 let mutation
6464 if ( isObject ( type ) && type . type ) {
65+ options = payload
6566 payload = mutation = type
6667 type = type . type
6768 } else {
@@ -77,7 +78,7 @@ class Store {
7778 handler ( payload )
7879 } )
7980 } )
80- if ( ! payload || ! payload . silent ) {
81+ if ( ! options || ! options . silent ) {
8182 this . _subscribers . forEach ( sub => sub ( mutation , this . state ) )
8283 }
8384 }
0 commit comments