Skip to content

victorbartel/operation-result

Repository files navigation

operation-result

A very basic result wrapper for JS/TS based projects. It works like an Optional type in Scala, but in the same time it remains more business oriented.

Usage example:

const result = Promise.resolve(1).then(success).catch(failure);

Or

if (isUnsuccessful(result)) {
    const message = `Impossible to proceed: ${result.reason}`;
    return abort(message);
}
return result;

About

result wrapper

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published