Skip to content

Commit 09245c2

Browse files
fix(overmind): fix operators effects and emit in production
1 parent f230d2b commit 09245c2

File tree

1 file changed

+8
-10
lines changed
  • packages/node_modules/overmind/src

1 file changed

+8
-10
lines changed

packages/node_modules/overmind/src/index.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,11 @@ export class Overmind<Config extends Configuration> implements Configuration {
265265
}
266266
private createExecution(name, action) {
267267
if (IS_PRODUCTION) {
268-
return {
268+
return ({
269269
getMutationTree: () => {
270270
return this.proxyStateTree.getMutationTree()
271271
},
272-
} as Execution
272+
} as any) as Execution
273273
}
274274

275275
const mutationTrees: any[] = []
@@ -337,14 +337,12 @@ export class Overmind<Config extends Configuration> implements Configuration {
337337
action[IS_OPERATOR]
338338
? action(
339339
null,
340-
Object.assign(
341-
{
342-
value,
343-
state: this.proxyStateTree.state,
344-
execution,
345-
},
346-
this.trackEffects(this.effects, execution)
347-
),
340+
{
341+
value,
342+
state: this.proxyStateTree.state,
343+
execution,
344+
effects: this.trackEffects(this.effects, execution),
345+
},
348346
(err, finalContext) => {
349347
finalContext &&
350348
this.eventHub.emit(EventType.ACTION_END, {

0 commit comments

Comments
 (0)