@functional-things/maybe
v1.0.0
Published
The maybe package from @functional-things.
Downloads
1
Maintainers
Readme
@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!");