Skip to content

Commit

Permalink
fix: timeout type
Browse files Browse the repository at this point in the history
  • Loading branch information
Soontao committed Nov 21, 2020
1 parent 5fa5757 commit 21cb8c9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/timeout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ export function createTimeoutPromise<T>(executor: Executor<T>, timeout = 60 * 10
}, timeout);

executor(
(...args: any[]) => {
(value) => {
if (!hasTimeout) {
clearInterval(timer);
resolve(...args);
resolve(value);
}
},
(...args: any[]) => {
(error) => {
if (!hasTimeout) {
clearInterval(timer);
reject(...args);
reject(error);
}
});
});
Expand Down

0 comments on commit 21cb8c9

Please sign in to comment.