Summary
In this chapter, you learned how to combine Immutable.js collections, starting with merging maps together. When maps are merged, there are usually conflicts with keys. You get to decide what happens when there's a conflict. When merging lists, conflicts are based on indexes and these need to be dealt with accordingly.
We then looked at concatenating lists of values. Side-effects have an easier time dealing with one collection instead of several collections. You can lazily concatenate collections using sequences so that you don't have to allocate new collections.
Interposing values into collections means putting the same value in-between every collection value. Interleaving collections balances the placement of values from several ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access