Generic Type Aliases in TypeScript
samundrak
JavaScript Dev- You can set generic in function by doing
Function <T> trigger(event: Event<T>){ return event.target; }
and here type of Event is typeEvent<T> = { target: T }
Function <T> trigger(event: Event<T>){ return event.target; }
and here type of Event is type Event<T> = { target: T }