0.0.5 • Published 2 years ago

lazy-batch v0.0.5

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

lazy-batch

Run tasks lazily in batches

  • Process when the num of inputs reaches limit
  • Process after max delay

Installation

$ npm install lazy-batch
# or
$ yarn add lazy-batch

Usage

import { LazyBatch } from "lazy-batch";

const batchProcess = (inputs: number[]) => {
  console.log(inputs);
}
const lazyBatch = new LazyBatch<number>(batchProcess, { maxLength: 2, maxDelay: 3000 });
lazyBatch.add(123);
lazyBatch.add(456);

// See [ 123, 456 ]
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