mapOrElseAsyncForUndefinable
Return the result of transformer with using input as an argument for it if input is not undefined
.
Otherwise, return the result of recoverer.
Basically, this operation is a combination map()
and unwrapOrElse()
.
U
must not beUndefinable<*>
.- If the result of transformer is
undefined
, this throw anError
. - If the result of recoverer is undefined
, this throw an
Error`.
- If the result of transformer is
- If you'd like to accept
Undefinable<*>
asU
, use a combinationandThen()
andorElse()
.
function mapOrElseAsyncForUndefinable<T, U>(
input: Undefinable<T>,
recoverer: AsyncRecoveryFn<NotUndefined<U>>,
transformer: AsyncTransformFn<T, NotUndefined<U>>,
): Promise<NotUndefined<U>>;§
mapOrElseAsyncForUndefinable<T, U>(input: Undefinable<T>, recoverer: AsyncRecoveryFn<NotUndefined<U>>, transformer: AsyncTransformFn<T, NotUndefined<U>>): Promise<NotUndefined<U>>
[src]§Parameters
§
input: Undefinable<T>
[src]§
recoverer: AsyncRecoveryFn<NotUndefined<U>>
[src]§
transformer: AsyncTransformFn<T, NotUndefined<U>>
[src]§Return Type
§
Promise<NotUndefined<U>>
[src]