Skip to content

Commit

Permalink
fix: typings
Browse files Browse the repository at this point in the history
  • Loading branch information
fupengl committed Jan 18, 2021
1 parent 299714d commit a10466b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/promise/async-pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ function asyncPool(options: AsyncPoolOpts) {
}
}

function executor(fn: PromiseFN) {
return new Promise((resolve, reject) => {
function executor<T>(fn: PromiseFN<T>) {
return new Promise<T>((resolve, reject) => {
queue.push(() => fn().then(resolve, reject));
next();
});
Expand Down
4 changes: 3 additions & 1 deletion src/promise/interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export type PromiseFN = () => Promise<void>;
export interface PromiseFN<T = any> {
(): Promise<T>;
}

export interface BaseRetryOpts {
/**
Expand Down

0 comments on commit a10466b

Please sign in to comment.