Package detail

funfix-effect

funfix3.2kApache-2.07.0.1

Sub-package of Funfix defining monadic data types for dealing with laziness and side effects

fp, functional-programming, concurrency, asynchrony

readme

funfix-effect

Join chat npm

Sub-project of Funfix defining monadic data types for controlling laziness, asynchrony and side effects.

Documentation

Links:

Usage

You can depend on the whole funfix library, by adding it to package.json:

npm install --save funfix

In this case imports are like:

import { Eval, IO } from "funfix"

Or for finer grained dependency management, the project can depend only on funfix-effect:

npm install --save funfix-effect

In this case imports are like:

import { Eval, IO } from "funfix-effect"

Usage sample:

import { IO } from "funfix"

const f1 = IO.of(() => "hello")
const f2 = IO.of(() => "world")

const greeting = IO.map2(f1, f2, (a, b) => a + " " + b)

greeting.run().onComplete(result =>
  result.fold(
    console.error,
    console.info
  ))

Modules: UMD and ES 2015

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.

License

Licensed under the Apache License, Version 2.0.

changelog

Change Log

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

5.0.1 (2017-08-24)

Features

  • split project in multi-project setup (#36) (59934bc)