toTaskEither<L> method

TaskEither<L, T> toTaskEither<L>(
  1. L onNull()
)

Convert a nullable type T? to TaskEither using a sync function:

  • Right if the value is not null
  • Left containing the result of onNull if the value is null

If you want to run an async function onNull, use toTaskEitherAsync.

Implementation

TaskEither<L, T> toTaskEither<L>(L Function() onNull) =>
    TaskEither.fromNullable(this, onNull);