extendable-immutable

1.3.3 • Public • Published

Wrapper classes around Immutable.js that turn it inheritable

Extendable Immutable.js

About

Ever wished that you could have OrderedMaps, Maps or Lists with extra methods, that make your life easier? .ofCourse()!

Getting Started

Installing the latest version via npm takes just a second:

npm install --save extendable-immutable

Import what you need:

import { OrderedMap } from 'extendable-immutable'
 
class Collection extends OrderedMap {
// ...

Quick Intro

import { OrderedMap } from 'extendable-immutable'
 
class Collection extends OrderedMap {
  static isCollection(val) {
    return val && val instanceof Collection;
  }
 
  doMagic() {
    return this.map(x => x.set("magic", true));
  }
}
 
const magic = new Collection();
 
magic instanceof Immutable.OrderedMap; // true
Immutable.OrderedMap.isOrderedMap(magic); // true

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.3.3
    1,406
    • latest

Version History

Package Sidebar

Install

npm i extendable-immutable

Weekly Downloads

1,082

Version

1.3.3

License

CC0-1.0

Last publish

Collaborators

  • philpl