Home > @idealeap/pipeline > MaybePromise
MaybePromise type
Represents a value that can be either a direct value of type T
or a Promise that resolves to type T
. Useful for functions that might return a value synchronously or asynchronously.
Signature:
typescript
export type MaybePromise<T> = T | Promise<T>;
export type MaybePromise<T> = T | Promise<T>;