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