Skip to content

Commit 937098d

Browse files
fix(overmind): fix operator issue with reaction
1 parent ec02f46 commit 937098d

File tree

1 file changed

+6
-4
lines changed
  • packages/node_modules/overmind/src

1 file changed

+6
-4
lines changed

packages/node_modules/overmind/src/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ export class Overmind<Config extends Configuration> implements BaseApp {
334334
[name]: configuration.reactions[name]((stateCb, action) => {
335335
action.displayName = name
336336
return [stateCb, action]
337-
}, this.createAction.bind(this, name)),
337+
}),
338338
})
339339
}
340340

@@ -345,8 +345,7 @@ export class Overmind<Config extends Configuration> implements BaseApp {
345345
(stateCb, action) => {
346346
action.displayName = name + '.' + subName
347347
return [stateCb, action]
348-
},
349-
this.createAction.bind(this, subName)
348+
}
350349
),
351350
}),
352351
{}
@@ -356,7 +355,10 @@ export class Overmind<Config extends Configuration> implements BaseApp {
356355
)
357356
Object.keys(reactions).forEach((name) => {
358357
const reaction = new Reaction(eventHub, proxyStateTree, name)
359-
reaction.create(reactions[name][0], reactions[name][1])
358+
reaction.create(
359+
reactions[name][0],
360+
this.createAction(name, reactions[name][1])
361+
)
360362
})
361363
}
362364
private getState(configuration: Configuration) {

0 commit comments

Comments
 (0)