AsyncResultExtension<S, E> extension

AsyncResult<S, E> represents an asynchronous computation.

on

Methods

flatMap<W>(AsyncResult<W, E> fn(S success)) AsyncResult<W, E>
Used to chain multiple functions that return a AsyncResult. You can extract the value of every Success in the chain without handling all possible missing cases. If any of the functions in the chain returns Error, the result is Error.
map<W>(W fn(S success)) AsyncResult<W, E>
If the AsyncResult is Success, then change its value from type S to type W using function fn.
mapError<W>(W fn(E error)) AsyncResult<S, W>
If the AsyncResult is Error, then change its value from type S to type W using function fn.
pure<W>(W success) AsyncResult<W, E>
Change a Success value.