Sub-package of Funfix exposing primitive interfaces and data types belonging into a standard library


Sub-project of Funfix, exposing primitive
interfaces and data types that need to be universally available,
belonging into a standard library.
Links:
- Homepage
- JSDoc documentation
You can depend on the whole funfix library, by adding it topackage.json:
``bash`
npm install --save funfix
In this case imports are like:
`typescript`
import { Option } from "funfix"
Or for finer grained dependency management, the project can depend
only on funfix-core:
`bash`
npm install --save funfix-core
In this case imports are like:
`typescript`
import { Option } from "funfix-core"
Usage sample:
`typescript
import { Try, Option, Either } from "funfix"
const opt1 = Option.of("hello")
const opt2 = Try.of(() => "world").toOption()
const greeting =
Option.map2(opt1, opt2, (a, b) => a + " " + b)
console.log(greeting.getOrElse("Ooops!"))
`
The library has been compiled using
UMD (Universal Module Definition),
so it should work with CommonJS
and AMD.
But it also provides a module definition in package.json`, thus
providing compatibility with
ECMAScript 2015 modules, for usage when used with a modern JS engine,
or when bundling with a tool chain that understands ES2015 modules,
like Rollup or Webpack.
Licensed under the Apache License, Version 2.0.