Q:

Immutable.js and flatMap equivalent function

Was just wondering if there an equivalent flatMap function in Immutable.js? I have been using this node package https://www.npmjs.com/package/flatmap for a while but I would prefer to write things like this
listObject.flatMap(x => ...)

Instead of
flatMap(listObject, x => ...)

A:

Actually, there is a flatMap function (see documentation).  
However, if you ever face a similar problem (you want to use foo.bar(args) instead of bar(foo, args)) you can create a custom property of your instance.
listObject.flatMap = a => flatMap(listObject, a);

And after that it is equivalent to write flatMap(listObject, x => ...) and listObject.flatMap(x => ...).

