Skip to content

Commit 2ac34e6

Browse files
feat(overmind): add addMutationListener to all views
1 parent 8a9ceb6 commit 2ac34e6

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

packages/node_modules/overmind-angular/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export const createConnect = <A extends Overmind<any>>(overmind: A) => () => {
3131
this.overmind = {
3232
state: this.__tree.state,
3333
actions: overmind.actions,
34+
addMutationListener: overmind.addMutationListener,
3435
}
3536
this.__shouldUpdatePaths = false
3637
this.__componentInstanceId = componentInstanceId++

packages/node_modules/overmind-react/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export const createHook = <A extends Overmind<Configuration>>(
109109
return {
110110
state: tree.state,
111111
actions: overmind.actions,
112+
addMutationListener: overmind.addMutationListener,
112113
}
113114
}
114115
}
@@ -180,6 +181,7 @@ export const createConnect = <A extends Overmind<Configuration>>(
180181
overmind: {
181182
state: this.tree.state,
182183
actions: overmind.actions,
184+
addMutationListener: overmind.addMutationListener,
183185
onUpdate: this.onUpdate,
184186
tree: this.tree,
185187
},
@@ -193,6 +195,7 @@ export const createConnect = <A extends Overmind<Configuration>>(
193195
overmind: {
194196
state: this.tree.state,
195197
actions: overmind.actions,
198+
addMutationListener: overmind.addMutationListener,
196199
},
197200
} as any)
198201
}

packages/node_modules/overmind-vue/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export const createConnect = <A extends Overmind<any>>(overmind: A) => <
5050
this.overmind = {
5151
state: this.__tree.state,
5252
actions: overmind.actions,
53+
addMutationListener: overmind.addMutationListener,
5354
}
5455
this.__tree.track(this.__onUpdate)
5556
beforeMount && beforeMount.call(this)

packages/node_modules/overmind/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ export class Overmind<Config extends Configuration> implements Configuration {
436436
getMutationTree() {
437437
return this.proxyStateTree.getMutationTree()
438438
}
439-
addMutationListener(cb) {
439+
addMutationListener = (cb) => {
440440
return this.proxyStateTree.onMutation(cb)
441441
}
442442
}

0 commit comments

Comments
 (0)