onSuccess method

void onSuccess(
  1. void onSuccess(
    1. R r
    )
)

Performs an action on the success value.

Implementation

void onSuccess(void Function(R r) onSuccess) {
  switch (this) {
    case Success<L, R>(value: final r):
      onSuccess(r);
    case Failure<L, R>():
      break;
  }
}