Skip to content

Commit 6fbee18

Browse files
feat(overmind-react): add reaction
1 parent 9afbe32 commit 6fbee18

File tree

1 file changed

+8
-0
lines changed
  • packages/node_modules/overmind-react/src

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export const createHook = <Config extends IConfiguration>(
6767
actions: Overmind<Config>['actions']
6868
effects: Overmind<Config>['effects']
6969
addMutationListener: (cb: IMutationCallback) => () => void
70+
reaction: Overmind<Config>['reaction']
7071
}) => {
7172
if (overmindInstance) {
7273
console.warn(
@@ -123,6 +124,7 @@ export const createHook = <Config extends IConfiguration>(
123124
actions: overmind.actions,
124125
effects: overmind.effects,
125126
addMutationListener: overmind.addMutationListener,
127+
reaction: overmind.reaction,
126128
}
127129
}
128130
const { current: tree } = useRef<any>(
@@ -192,6 +194,7 @@ export const createHook = <Config extends IConfiguration>(
192194
actions: overmind.actions,
193195
effects: overmind.effects,
194196
addMutationListener: overmind.addMutationListener,
197+
reaction: overmind.reaction,
195198
}
196199
}
197200
}
@@ -205,6 +208,7 @@ export const createConnect = <ThisConfig extends IConfiguration>(
205208
overmind: {
206209
state: Overmind<ThisConfig>['state']
207210
actions: Overmind<ThisConfig>['actions']
211+
reaction: Overmind<ThisConfig>['reaction']
208212
}
209213
}
210214
>
@@ -265,6 +269,7 @@ export const createConnect = <ThisConfig extends IConfiguration>(
265269
addMutationListener: this.overmind.addMutationListener,
266270
onUpdate: this.onUpdate,
267271
tree: this.tree,
272+
reaction: this.overmind.reaction,
268273
},
269274
}
270275
this.wrappedComponent = (...args) =>
@@ -285,6 +290,7 @@ export const createConnect = <ThisConfig extends IConfiguration>(
285290
addMutationListener: this.overmind.addMutationListener,
286291
onUpdate: this.onUpdate,
287292
tree: this.tree,
293+
reaction: this.overmind.reaction,
288294
},
289295
})
290296
}
@@ -328,6 +334,7 @@ export const createConnect = <ThisConfig extends IConfiguration>(
328334
addMutationListener: this.overmind.addMutationListener,
329335
onUpdate: this.onUpdate,
330336
tree: this.tree,
337+
reaction: this.overmind.reaction,
331338
},
332339
}
333340
this.wrappedComponent = (...args) =>
@@ -375,6 +382,7 @@ export const createConnect = <ThisConfig extends IConfiguration>(
375382
addMutationListener: this.overmind.addMutationListener,
376383
onUpdate: this.onUpdate,
377384
tree: this.tree,
385+
reaction: this.overmind.reaction,
378386
},
379387
})
380388
}

0 commit comments

Comments
 (0)