operation-result
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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;

Readme

Keywords

none

Package Sidebar

Install

npm i operation-result

Weekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

15.5 kB

Total Files

9

Last publish

Collaborators

  • victorbartel