Closed mbicknese closed 5 years ago
Calling the end method on the tracker instance does not correctly remove the listeners. I would have submitted a solution, but I cannot get puppeteer to work on Windows.
end
Suggested solution, apply following patch
+++ b/src/index.js @@ -26,8 +26,9 @@ class IdleTracker { start = ({ onIdleCallback } = {}) => { this.callback = onIdleCallback || this.callback; + this.handleEvent = this.handleEvent.bind(this); this.listeners = this.events.map(eventName => { - document.addEventListener(eventName, this.handleEvent.bind(this), false); + document.addEventListener(eventName, this.handleEvent, false); return eventName; });
ah, the context. Thanks! Will take a look in a bit
Publish 0.0.6 Thanks!
0.0.6
https://github.com/roderickhsiao/idle-tracker/releases/tag/0.0.6
Calling the
end
method on the tracker instance does not correctly remove the listeners. I would have submitted a solution, but I cannot get puppeteer to work on Windows.Suggested solution, apply following patch