Skip to content

Commit

Permalink
Fix action builder tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KlapTrap committed Sep 20, 2019
1 parent c6b23bd commit 393425a
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,15 @@ export class ActionOrchestrator<T extends OrchestratedActionBuilders = Orchestra
}

public getActionBuilder<Y extends keyof T>(actionType: Y): T[Y] {
const actionBuilderForType = this.actionBuilders[actionType];
if (!actionBuilderForType) {
return null;
}
const actionBuilder: T[Y] = (...args: Parameters<T[Y]>) => {
const action = this.actionBuilders[actionType](...args) as ActionBuilderAction;
action.actionBuilderActionType = actionType as string;
const action = actionBuilderForType(...args) as ActionBuilderAction;
if (action) {
action.actionBuilderActionType = actionType as string;
}
return action;
};
return actionBuilder;
Expand Down

0 comments on commit 393425a

Please sign in to comment.