Skip to content

Latest commit

 

History

History
32 lines (22 loc) · 525 Bytes

README.md

File metadata and controls

32 lines (22 loc) · 525 Bytes

@alfonsoperez/fixed-queue

npm version

A simple immutable Fixed Queue

Installation

yarn add @alfonsoperez/fixed-queue

or

npm install @alfonsoperez/fixed-queue --save

Usage

import { FixedQueue } from "@alfonsoperez/fixed-queue";

const queue = new FixedQueue({
  size: 3,
  initialValues: ["A", "B"]
});

queue
  .push("C", "D")
  .values(); // ["B", "C", "D"]