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