Skip to content

Commit d6269d7

Browse files
refactor(overmind): statecharts transition should happen before action runs
1 parent ebf5e0f commit d6269d7

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

packages/node_modules/overmind/src/config/statechart.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,6 @@ export function statechart<C extends IConfiguration, S extends string>(
198198
return actions[key](context, payload)
199199
}
200200

201-
const result = actions[key](context, payload)
202-
203201
const stateTarget = getTarget(
204202
context.state,
205203
context.execution.namespacePath
@@ -283,7 +281,7 @@ export function statechart<C extends IConfiguration, S extends string>(
283281
})
284282
}
285283

286-
return result
284+
return actions[key](context, payload)
287285
})
288286
)
289287

0 commit comments

Comments
 (0)