get-immutable-from-exotic-js
v1.0.0
Published
Like Immutable.fromJS, but will convert any Object, including exotic Objects, to Immutable.Map
Downloads
3
Readme
get-immutable-from-exotic-js
Installation
npm install get-immutable-from-exotic-js --save
Syntax
getImmutableFromExoticJS(obj)
Usage
import getImmutableFromExoticJS from 'get-immutable-from-exotic-js';
const User = function(name, age){
this.name = name;
this.age = age;
};
const users = [
new User('John', 20),
new User('Jane', 25)
];
const list = getImmutableFromExoticJS(users);
// List will be an Immutable.List containing Immutable.Maps INSTEAD OF instances of User.
Tests
npm test
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.
Release History
- 1.0.0 Initial release