Skip to content

Commit

Permalink
Prefer using window.setTimeout() and window.setInterval()
Browse files Browse the repository at this point in the history
Shows the compiler that we’re using DOM timers and intervals, rather than Node.js globals
  • Loading branch information
colinrotherham committed Jun 20, 2023
1 parent 28d016a commit 465294b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export class Button {
return false
}

this.debounceFormSubmitTimer = setTimeout(() => {
this.debounceFormSubmitTimer = window.setTimeout(() => {
this.debounceFormSubmitTimer = null
}, DEBOUNCE_TIMEOUT_IN_SECONDS * 1000)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export class CharacterCount {
* @private
*/
handleFocus () {
this.valueChecker = setInterval(() => {
this.valueChecker = window.setInterval(() => {
if (!this.lastInputTimestamp || (Date.now() - 500) >= this.lastInputTimestamp) {
this.updateIfValueChanged()
}
Expand Down

0 comments on commit 465294b

Please sign in to comment.