Skip to main content

foldW()

const foldW: <B, A, C>(onNone, onSome) => (ma) => B | C = matchW

Alias for matchW.

Pattern matches on an Option with widened return types.


Type Parametersโ€‹

B: Bโ€‹

The return type for None.

A: Aโ€‹

The value type.

C: Cโ€‹

The return type for Some.


Parametersโ€‹

onNone: () => Bโ€‹

Handler for None case.

onSome: (a) => Cโ€‹

Handler for Some case.


Returnsโ€‹

A function that matches the Option.


Sinceโ€‹

2.0.0