- Mastering Immutable.js
- Adam Boduch
- 63字
- 2021-07-08 10:30:06
Ordered maps
An ordered map is just like a map except that the order in which items are added is preserved. This type of map behaves like a list, only instead of looking up values using numerical indexes, you can use any key you like:
import { OrderedMap } from 'immutable';
const myOrderedMap = OrderedMap();
console.log('OrderedMap', myOrderedMap instanceof OrderedMap);
// -> OrderedMap true