0.2.0 • Published 8 years ago

immutable-box v0.2.0

Weekly downloads
-
License
BSD-3-Clause
Repository
bitbucket
Last release
8 years ago

Immutable Box wercker status

A module that provides a simple immutable box. Use it to establish a powerful linear data flow in JavaScript. (As seen in this lovely Egghead course.)

API Reference

Installing / Getting Started

Install the package

npm install --save immutable-box

and import/require it

import Box from 'immutable-box';
// OR (pre ES6)
var Box = require('immutable-box');

Usage

Box('value') // put 'value' in a box
  .map((v) => `new ${v}`) // update the box' value
  .get(); // return the box' value (here: 'new value')

Box('1')
  .asMutable() // make the box mutable
  .map((v) => parseInt(v, 10))
  .map((v) => v + 1)
  .includes(2); // compare the box' value (returns true)

Developing

This is what you do after you have cloned the repository:

npm install
npm run build

(Install dependencies & build the project.)

Linting

Execute ESLint

npm run lint

Try to automatically fix linting errors

npm run lint:fix

Testing

Execute Jest unit tests using

npm test

Tests are defined in the same directory the module lives in. They are specified in 'module.test.js' files.

Building

To build the project, execute

npm run build

This saves the production ready code into 'dist/'.

Documentation

The app is documented using JSDoc. To generate docs, use

npm run docs

This saves HTML documentation into 'docs/'. It requires that you have additionally installed jsdoc.

To generate a Markdown API reference, you can alternatively use

npm run docs-md

This saves the documentation into 'docs/index.md'. It requires that you have additionally installed jsdoc-to-markdown.

0.2.0

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago