1.1.2 • Published 4 years ago

little-monad-that-could v1.1.2

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

Little Monad That Could

NPM

Simple null-safe monad for handling singular values as well as arrays.

Installation

Module can be easily installed with NPM:

npm install --save little-monad-that-could

Usage

Simply require it in your code:

const { when, pipe, get, filter } = require('little-monad-that-could');

const life = { life: 42 }
const universe = value => value + 12
const everything = value => value === 6 * 9

when(life)
    .get('life')
    .map(universe)
    .filter(everything)
    .otherwise(0)

const compute = pipe(
    get('life'),
    universe,
    filter(everything))

compute(life).otherwise(0)
1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago