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
Post a Comment