flatMapThrowable<B> method
Return a new Option that calls Option.tryCatch with the given function f
.
expect(
Option.of(123).flatMapThrowable((_) => throw Exception()),
Option.of(123).flatMapThrowable((_) => 456),
Option.of(456),
);
Implementation
Option<B> flatMapThrowable<B>(B Function(T t) f) =>
flatMap((t) => Option.tryCatch(() => f(t)));