Page Contents

Home > @loopback/context > AsValueOrPromise

AsValueOrPromise type

Create the Promise type for T. If T extends Promise, the type is T, otherwise the type is ValueOrPromise<T>.

Signature:

export declare type AsValueOrPromise<T> = T extends Promise<unknown> ? T : ValueOrPromise<T>;