1.1.0 • Published 3 years ago

@obsidize/command-queue v1.1.0

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

@obsidize/command-queue

A stupidly simple async queue.

Designed primarily to guard single-entry-point interfaces from being bombarded with calls from independent sources (e.g. multiple angular components hitting a single cordova API at once).

Installation

  • npm:
npm install --save @obsidize/command-queue

Usage

import {CommandQueue} from '@obsidize/command-queue';

const queue = new CommandQueue();
const result = await queue.add(() => doSomePromiseStuff());

const resultList = await Promise.all([1, 2, 3, 4, 5].map(v => {
	return queue.add(() => doSomePromiseStuffSerially(v));	
}));

// If the result is a deferred Observable
const observable = queue.observe(() => generatedDeferredObservable());

API

Source documentation can be found here

1.1.0

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago