call method

Either<Exception, OUTPUT> call(
  1. INPUT input
)

Executes the use case synchronously with the given input.

Returns an Either containing an Exception on failure

  • INPUT - The type of parameters required to execute the use case.
  • OUTPUT on success.

Implementation

Either<Exception, OUTPUT> call(INPUT input) {
  for (final validator in _validators) {
    final result = validator(input);
    if (result.isLeft) return Left(result.left!);
  }
  return run(input);
}