matchW()
matchW<
B,A,C>(onNone,onSome): (ma) =>B|C
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