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;

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    0
  • 1.0.1
    0
  • 1.0.0
    0

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