How can I avoid the confusion of native Map with Immutable.Map?
I use immutable.js in a react project (ES6 or later, transpiled with babel). So a lot of files start with an import like:
import { Map } from 'immutable';
Everything is fine until somebody adds the above import to a file that uses native JS Map, so that new Map() becomes an Immutable.Map.
I could consequently import the whole immutable library (import Immutable from 'immutable';) and reference it using Immutable.Map. However, this has possibly impact on the size of the resulting code (the compiler is likely not able to figure out that not the whole imported lib is used) and probably does not look nice.
Are there better solutions? Can I somehow reference native JS Map specifically?