Skip to content

Commit

Permalink
Merge 0843fdf into 4395ff7
Browse files Browse the repository at this point in the history
  • Loading branch information
draperunner committed Sep 11, 2020
2 parents 4395ff7 + 0843fdf commit 13f2b07
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ export interface QueueOptions {
signal?: AbortSignal
}

type PromiseCreator<T> = () => Promise<T>

export default class PromiseThrottle {
constructor(options: ThrottleOptions)
add<T>(promise: Promise<T>, opts?: QueueOptions): Promise<T>
addAll<T>(promises: Promise<T>[], opts?: QueueOptions): Promise<T[]>
add<T>(promiseCreator: PromiseCreator<T>, opts?: QueueOptions): Promise<T>
addAll<T>(promisesCreators: PromiseCreator<T>[], opts?: QueueOptions): Promise<T[]>
}

0 comments on commit 13f2b07

Please sign in to comment.