@functional-things/maybe
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@functional-things/maybe

Maybe type for TypeScript.

This package provides a (embarassingly trivial) Maybe type for TypeScript.

Install

$ npm install --save @functional-things/maybe

Usage

import { Maybe } from "@functional-things/maybe";

const operationThatCanFail = (...args: any[]): Maybe<ResultType> =>
{
    // ...
};

const result = operationThatCanFail(/* ... */);

if (result !== null)
    console.error("Operation failed!");

Package Sidebar

Install

npm i @functional-things/maybe

Weekly Downloads

2

Version

1.0.0

License

Unlicense

Unpacked Size

62.9 kB

Total Files

8

Last publish

Collaborators

  • joebobmiles