Skip to content

Instantly share code, notes, and snippets.

Jonathan Law Jonathan-Law

Block or report user

Report or block Jonathan-Law

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Jonathan-Law
Jonathan-Law / Batch.ts
Last active Oct 2, 2019 — forked from ccnokes/Batch.ts
A class that manages the logic of batching items together within a timeframe and then passing those items to a function. Sandbox: https://codesandbox.io/s/v86lv7k89l
View Batch.ts
type Resolve = <T>(value?: T | PromiseLike<T>) => Promise<T>;
type Reject = <T>(reason?: any) => Promise<T>;
/**
* Deferred
*
* A deferred promise class used to create delayed promise resolutions
*/
export class Deferred<T> {
promise: Promise<T>;
You can’t perform that action at this time.