flush-queue

1.0.1 • Public • Published

flush-queue Build Status

Queue a set of functions to be executed synchronously

Installing

$ npm install flush-queue

API

A FlushQueue is a subclass of Set. You'll manipulate the queue with Set methods like add, delete, and clear.

queue.flush() -> undefined

Calling queue.flush will iterate through the functions in the queue, in insertion order, calling each. If the queue is empty when flush is called, an exception is thrown. The queue protects against recursive flush calls, so you can do this:

queue.add(() => {
  queue.flush()
})

Package Sidebar

Install

npm i flush-queue

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • bendrucker