Skip to main content

flatMapOption()

flatMapOption<A, B, E2>(f, onNone): <E1>(self) => Either<E2 | E1, B>

FlatMaps over an Option result.


Type Parametersโ€‹

A: Aโ€‹

The input type.

B: Bโ€‹

The output type.

E2: E2โ€‹

The error type for None.


Parametersโ€‹

f: (a) => objectโ€‹

The mapping function.

onNone: (a) => E2โ€‹

Function to create error for None.


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

A function that flatMaps the Either.


Sinceโ€‹

2.0.0