0.0.7 • Published 2 years ago

@reframework/q v0.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago