ActionType should be generic
sandangel opened this issue · 1 comments
sandangel commented
current implement:
symbols.ts
export type ActionType = { new (...args: any[]): Action };
We can add generic type for ActionType like this:
export type ActionType<T extends Action = Action> = { new (...args: any[]): T };
Then we can reuse it, i.e in of-action.ts
import { ActionType } from './symbols';
export function ofAction<T extends Action>(allowedType: ActionType<T>): OperatorFunction<Action, T>;
or in action.ts
export function Action(...actionsKlasses: ActionType[]) { ... }
albyrock87 commented
You always have good ideas 🥇
Thank you