Parameters
-
handler: ((awaitable) => Output)
-
- (awaitable): Output
-
Returns Output
Returns (<AwaitableValue>(awaitable) => AwaitableValue extends Promise<Value>
? Promise<Output>
: Output)
Curried function with handler
in context.
-
- <AwaitableValue>(awaitable): AwaitableValue extends Promise<Value>
? Promise<Output>
: Output
-
Parameters
-
awaitable: AwaitableValue
Returns AwaitableValue extends Promise<Value>
? Promise<Output>
: Output
If the given value is a promise, the
handler
is called when is resolved, otherwise the handler is called directly with the value.Example