- Mastering Immutable.js
- Adam Boduch
- 61字
- 2021-07-08 10:30:07
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