上QQ阅读APP看书,第一时间看更新
Immutable.js constructors
The Immutable.js API exposes immutable collections as classes. You then use these classes to create new collection instances. This is just like any other object-oriented JavaScript API that exposes classes. There is one important difference, though—these aren't real classes.
There are a number of internal implementation reasons for why Immutable.js doesn't expose actual classes as its API. One reason is that in some cases, collection instances can be reused, such as when creating empty collections. The only thing to keep in mind is that you never need to use the new keyword when creating Immutable.js data.