when<W> abstract method
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,
);