plain-either

1.2.0 • Public • Published

Either 👎/👍

Very simple implementation of an Either.

What is it?

Either represents the possibility of two states, which are correct or error.

But... why would I need that?

In Typescript/Javascript you can throw errors, but errors are somewhat unchecked (means they are not checked at transpile-time) and someone needs to catch them; otherwise they'll bubble up and make your program crash. Sometimes, you are not even aware that a method might throw an error (e.g., because it's bubbling up from another method) so you might not even think about surrounding your code with a try/catch block.

Readme

Keywords

none

Package Sidebar

Install

npm i plain-either

Weekly Downloads

0

Version

1.2.0

License

ISC

Unpacked Size

10 kB

Total Files

11

Last publish

Collaborators

  • dti-bot