Functional Immutable
Iteratee-first data-last null-safe curried functions wrapper for immutable.js
Are you using Immutable.js with React and Redux? Take a look at react-redux-immutabe for mapping your immutable state to your props without performance hit.
Installation
Functional Immutable relies on a single peer dependency, it requires Immutable 3 already installed.
npm install --save functional-immutable
Usage
Functional Immutable aims to provide all immutable object methods as curried, data-last, null-safe functions. It is designed to work seamlessly in an point-free style program.
For example :
;;; const immutableObject = Immutable; const getUppercaseLastName = fp; ; // SKYWALKER; // DOE
Also, Functional Immutable is non-opinionated and will work with any point-free library such as Ramda.
;;; const immutableObject = Immutable; const getUppercaseLastName = R; ; // SKYWALKER; // DOE
It should also shine with Redux selectors such as reselect or re-reselect.
;;; const applicationState = Immutable; const getUppercaseLastName = ; ; // SKYWALKER; // DOE
Api Changes
delete
=> deleteAt
delete
being a reserved keyword, the delete method has been re-exported as deleteAt
.
Contribute
Something missing?
Found a missing function? Feel free to contribute by opening a Pull Request.
This wrapper relies on naïve re-exports of Immutable object methods. Here is how to add a missing method called missing
.
In index.js add the following:
const missing = ;
Test coverage
You can also contribute by writing unit tests, for example by rewriting existing Immutable 3 Unit Tests using functional-immutable
.