Mastering Immutable.js
上QQ阅读APP看书,第一时间看更新

Ordered sets

An ordered set is just like a set. It doesn't allow duplicate values, but it does maintain the iteration order. This works the same way as with an ordered map—the iteration order is the same as the insertion order:

import { OrderedSet } from 'immutable';
const myOrderedSet = OrderedSet();
console.log('OrderedSet', myOrderedSet instanceof OrderedSet);
// -> OrderedSet true