Skip to content

Commit

Permalink
refactor: 💡 change return type of getAction as per review
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Mar 23, 2020
1 parent 0dafa57 commit 29ee51c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/plugins/ui_actions/public/service/ui_actions_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
ActionFactory,
ActionDefinition,
ActionFactoryDefinition,
ActionContext,
} from '../actions';
import { Trigger, TriggerContext } from '../triggers/trigger';
import { TriggerInternal } from '../triggers/trigger_internal';
Expand Down Expand Up @@ -156,7 +157,9 @@ export class UiActionsService {
this.attachAction(triggerId, action.id);
};

public readonly getAction = <T extends ActionDefinition>(id: string): ActionInternal<T> => {
public readonly getAction = <T extends ActionDefinition>(
id: string
): Action<ActionContext<T>> => {
if (!this.actions.has(id)) {
throw new Error(`Action [action.id = ${id}] not registered.`);
}
Expand Down

0 comments on commit 29ee51c

Please sign in to comment.