Skip to content

reframework/queue

Repository files navigation

AboutInstallationExampleApiLicense

About

A simple queue

forthebadge

A simple queue for the front end.

Installation

npm install --save @refamework/q

Example

The queue can be initiated with a static method create() instead or new operator:

https://codesandbox.io/s/inspiring-sanne-yjxrhe?file=/src/App.js

import Queue from '@reframework/queue';

const queue = new Queue();
// The same with static method
const queue = Queue.create();

Api

interface IQueue<Task> {
  enqueue: (task: Task) => IQueue
  dequeue: (filterFn: (task: Task) => boolean) => void;
  onDone: (listener: () => void) => void;
  onProcess: (listener: (task: Task, next: () => void) => void) => void;
  onEmpty: () => void;
  pipe: (queue: IQueue) => IQueue;
}

License

MIT

About

A tiny queue

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •