const successfulResult = asyncResult(Promise.resolve('some value')).map(value => value + ', another value');await successfulResult.orNull(); // produces: "some value, another value" Copy
const successfulResult = asyncResult(Promise.resolve('some value')).map(value => value + ', another value');await successfulResult.orNull(); // produces: "some value, another value"
const failureResult = asyncResult(Promise.reject('some failure')).or(reason => asyncFailure(reason + ', another failure'));await failureResult.orNull(); // produces: nullawait failureResult.orElse('Not this'); // produces: "Not this" Copy
const failureResult = asyncResult(Promise.reject('some failure')).or(reason => asyncFailure(reason + ', another failure'));await failureResult.orNull(); // produces: nullawait failureResult.orElse('Not this'); // produces: "Not this"