mapOrElseForMaybe
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 mapOrElseForMaybe<T, U>(
input: Maybe<T>,
recoverer: RecoveryFn<NotNullOrUndefined<U>>,
transformer: TransformFn<T, NotNullOrUndefined<U>>,
): NotNullOrUndefined<U>;§
mapOrElseForMaybe<T, U>(input: Maybe<T>, recoverer: RecoveryFn<NotNullOrUndefined<U>>, transformer: TransformFn<T, NotNullOrUndefined<U>>): NotNullOrUndefined<U>
[src]§Parameters
§
recoverer: RecoveryFn<NotNullOrUndefined<U>>
[src]§
transformer: TransformFn<T, NotNullOrUndefined<U>>
[src]