Skip to content

Commit

Permalink
fix: Disconnect MutationObserver synchronously in wait-for (#801)
Browse files Browse the repository at this point in the history
* Disconnect MutationObserver synchronously in wait-for

* Revert the pre-commit change to be able to commit

* Remove legacy disconnect

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
  • Loading branch information
romain-trotard and kentcdodds authored Nov 3, 2020
1 parent 2cc8a11 commit 2cb8405
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wait-for.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function waitFor(

if (!usingFakeTimers) {
clearInterval(intervalId)
setImmediate(() => observer.disconnect())
observer.disconnect()
}

if (error) {
Expand Down

0 comments on commit 2cb8405

Please sign in to comment.