batchinator
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

batchinator

Group method calls within the same tick

Install

$ yarn add batchinator

Usage

import batchinator from 'batchinator';
 
const load = batchinator((keys: string[]) => {
  return new Promise<string[]>(resolve => {
    const newIds = ids.map(id => `${id}-foo`);
 
    resolve(newIds);
  });
});
 
load(1);
load(2);

Readme

Keywords

none

Package Sidebar

Install

npm i batchinator

Weekly Downloads

1

Version

0.0.3

License

MIT

Unpacked Size

11.8 kB

Total Files

11

Last publish

Collaborators

  • zzarcon