Skip to content

Commit

Permalink
refactor: split name and args
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Jan 9, 2019
1 parent 113ed22 commit 05c89ec
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,10 @@ exports.Store = class Store {

return {
context: {
dispatch: (...args) => {
args[0] = key + args[0]
this.dispatch(...args)
},
commit: (...args) => {
args[0] = key + args[0]
this.commit(...args)
},
dispatch: (name, ...args) =>
this.dispatch(key + name, ...args),
commit: (name, ...args) =>
this.commit(key + name, ...args),
// make sure we reuse this proxy
_modulesNamespaceMap: this._modulesNamespaceMap,
// pass the right state
Expand Down

0 comments on commit 05c89ec

Please sign in to comment.