Skip to content

Commit

Permalink
fix: clearTimeout instead of clearInterval (#1305)
Browse files Browse the repository at this point in the history
jest modern timers break because the stale timeout is created with setTimeout but cleared with clearInterval
  • Loading branch information
AngusMorton committed Nov 20, 2020
1 parent a56a5b5 commit 7535383
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/queryObserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export class QueryObserver<TResult, TError> {

private clearStaleTimeout(): void {
if (this.staleTimeoutId) {
clearInterval(this.staleTimeoutId)
clearTimeout(this.staleTimeoutId)
this.staleTimeoutId = undefined
}
}
Expand Down

1 comment on commit 7535383

@vercel
Copy link

@vercel vercel bot commented on 7535383 Nov 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.