Skip to main content

flatMapNullable()

flatMapNullable<A, B, E2>(f, onNullable): <E1>(self) => Either<E2 | E1, NonNullable<B>>

FlatMaps over a nullable result.


Type Parametersโ€‹

A: Aโ€‹

The input type.

B: Bโ€‹

The output type.

E2: E2โ€‹

The error type for null/undefined.


Parametersโ€‹

f: (a) => Nullish<B>โ€‹

The mapping function.

onNullable: (a) => E2โ€‹

Function to create error for null/undefined.


Returns: <E1>(self): Either<E2 | E1, NonNullable<B>>โ€‹

A function that flatMaps the Either.


Sinceโ€‹

2.0.0