Skip to content

zzarcon/batchinator

Repository files navigation

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);

About

Group method calls within the same tick (type-safe)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published