get-immutable-from-exotic-js

Like Immutable.fromJS, but will convert any Object, including exotic Objects, to Immutable.Map

Usage no npm install needed!

<script type="module">
  import getImmutableFromExoticJs from 'https://cdn.skypack.dev/get-immutable-from-exotic-js';
</script>

README

get-immutable-from-exotic-js

Build Status

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