fromNullable<A> function

TaskOption<A> fromNullable<A>(
  1. A? a
)

Create a TaskOption from a value that could be null. If it is not null, then it will resolve to Some. null values become None.

expect(
  await fromNullable('hello')(),
  O.some('hello'),
);
expect(
  await fromNullable(null)(),
  O.none(),
);

Implementation

TaskOption<A> fromNullable<A>(A? a) => TaskOption(T.value(O.fromNullable(a)));