onOk method

Future<Result<T>> onOk(
  1. dynamic f(
    1. T
    )
)

Calls f(result.val) with side effect if this result is Ok. Anyway returns this result as is.

Implementation

Future<Result<T>> onOk(Function(T) f) {
  return then((resultT) {
    if (resultT.isOk) {
      f(resultT.val!);
    }
    return this;
  });
}