Skip to content

Commit

Permalink
fix: failure to clear timeout immediately
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards1211 committed Jul 20, 2020
1 parent 56667b6 commit 247701f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ function poll<T>(
}

if (await until(error, result)) {
if (timeoutId != null) clearTimeout(timeoutId)
if (error) reject(error)
else resolve((result: any))
}
Expand Down

0 comments on commit 247701f

Please sign in to comment.