Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kitten/extendable-immutable
Wrapper classes around Immutable.js that turn it inheritable
https://github.com/kitten/extendable-immutable
immutable immutablejs
Last synced: about 1 month ago
JSON representation
Wrapper classes around Immutable.js that turn it inheritable
- Host: GitHub
- URL: https://github.com/kitten/extendable-immutable
- Owner: kitten
- License: cc0-1.0
- Archived: true
- Created: 2016-08-01T16:42:32.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-06T00:38:47.000Z (almost 7 years ago)
- Last Synced: 2024-05-21T04:16:08.193Z (7 months ago)
- Topics: immutable, immutablejs
- Language: JavaScript
- Homepage:
- Size: 875 KB
- Stars: 57
- Watchers: 3
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-react - extendable-immutable - Extend any Immutable.js data structure
README
Wrapper classes around Immutable.js that turn it inheritable
# Extendable [Immutable.js](https://github.com/facebook/immutable-js/)
## About
Ever wished that you could have OrderedMaps, Maps or Lists with extra methods,
that make your life easier? `.ofCourse()`!- Behaves like normal [Immutable.js](https://github.com/facebook/immutable-js/) data structures
- Doesn't break [Immutable.js'](https://github.com/facebook/immutable-js/) inheritance (*.is and instanceof still pass!)## Getting Started
Installing the latest version via npm takes just a second:
```bash
npm install --save extendable-immutable
```Import what you need:
```js
import { OrderedMap } from 'extendable-immutable'class Collection extends OrderedMap {
// ...
```## Quick Intro
```js
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
```