immutable.js - How to calculate difference between two Maps in ImmutableJS? -


i have 1 parent map , want divide logic.

let m = map(); let sub1 = m.filter((el) => el.isfiltered()); 

how can rest of map? know can invert condition inside filter, want know if there method analogue _.difference in underscore?

you can use groupby both subsets 1 iteration round:

let m = map(); let grouped = m.groupby((el) => el.isfiltered()); let pass = grouped.get(true) let fail = grouped.get(false) 

example on jsbin: http://jsbin.com/gavikufefi/edit?js,console


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -