x/evt@v1.10.2/tools/typeSafety/UnpackPromise.ts

šŸ’§EventEmitter's typesafe replacement
GitHub Stars
382
Go to Latest

/** * Usecase: * declare const pr: Promise<string[]>; * const x: Unpack<typeof pr>; <== x is string[] */export type UnpackPromise<T> = T extends PromiseLike<infer U> ? U : never;