when<W> abstract method

W when<W>(
  1. SuccessCallback<W, S> whenSuccess,
  2. ErrorCallback<W, E> whenError
)

Handle the result when success or error

if the result is an error, it will be returned in whenError if it is a success it will be returned in whenSuccess

Implementation

W when<W>(
  SuccessCallback<W, S> whenSuccess,
  ErrorCallback<W, E> whenError,
);