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

Stacks

A stack is like a list because it's an indexed collection. The main difference with stacks is that they're really good at adding and removing values from the front of the collection. If you're implementing something that's first-in, first-out (FIFO), stacks are a good bet. Otherwise, stay away from stacks:

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