A simple immutable Fixed Queue
yarn add @alfonsoperez/fixed-queue
or
npm install @alfonsoperez/fixed-queue --save
import { FixedQueue } from "@alfonsoperez/fixed-queue";
const queue = new FixedQueue({
size: 3,
initialValues: ["A", "B"]
});
queue
.push("C", "D")
.values(); // ["B", "C", "D"]