immutable-extras
Simple extensions for the Immutable.js library
Install
npm install --save immutable-extras
yarn add immutable-extras
Usage
;; const someList = Immutable; const uniqueList = someList;// uniqueList ->// [ { id: 5, name: 'a' }, { id: 15, name: 'b' } ] const mapped = someList;// mapped ->// {// a: { id: 5, name: 'a' },// b: { id: 15, name: 'b' },// c: { id: 5, name: 'c' },// } const sortedList = Immutable// sortedList ->// ["ab", "bb", "bd", "c"] const groupedList = Immutable// groupedList ->// [ [ '1', '2' ], [ '3', '4' ]] const safeSetMap = Immutable// safeSetMap ->// {// a: {// b: 'c'// }// } {}const classList1 = Immutable;const classList2 = ImmutableList;// classList1 ->// Immutable.List([ TestClass(...) ])// classList2 ->// Immutable.List([ TestClass(...) ])