Skip to content

Commit

Permalink
Merge pull request #20 from Holmwoods/remove-throttling-visibility-ch…
Browse files Browse the repository at this point in the history
…ange

Remove throttling for visibility change event
  • Loading branch information
rosskevin authored Sep 4, 2024
2 parents 1077ec4 + 990a6bc commit 274fb19
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/IfVisible.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,7 @@ export class IfVisible {

//-----------------------------
// instantiate listeners for doc and store them
this.docListeners[resolveVisibilityChangeEvent(this.doc) as 'visibilitychange'] = throttle(
() => this.trackChange(),
this.throttleDuration,
)
this.docListeners[resolveVisibilityChangeEvent(this.doc) as 'visibilitychange'] = () => this.trackChange()

for (const name of ['mousemove', 'mousedown', 'keyup', 'touchstart']) {
this.docListeners[name] = throttle(() => this.startIdleTimer(), this.throttleDuration)
Expand Down

0 comments on commit 274fb19

Please sign in to comment.