when<W> 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
@override
W when<W>(
SuccessCallback<W, S> whenSuccess,
ErrorCallback<W, E> whenError,
) =>
whenSuccess(_success);