Skip to content

Commit

Permalink
Remove redundant resolveActionsAndContext call (#4061)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Jun 7, 2023
1 parent bbea3bc commit df55ac0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/core/src/StateMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,9 @@ export class StateMachine<
| State<TContext, TEvent, TResolvedTypesMeta>
| StateConfig<TContext, TEvent>
): State<TContext, TEvent, TResolvedTypesMeta> {
const state =
stateConfig instanceof State ? stateConfig : new State(stateConfig, this);

return resolveActionsAndContext([], state.event, state, undefined)[0];
return stateConfig instanceof State
? stateConfig
: new State(stateConfig, this);
}

public getStatus(state: State<TContext, TEvent, TResolvedTypesMeta>) {
Expand Down

0 comments on commit df55ac0

Please sign in to comment.