Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentWillUnmount() {
const { emitter } = this.props;
allOff(emitter);
}
unload() {
if(!this._scrollElement) return this
this._loaded = false
allOff(this._emitter)
this._scrollElement.removeScrollEventListener(this.onScroll)
this._scrollElement.removeEventListener('touchstart', this.onTouchStart)
this._scrollElement.removeEventListener('touchmove', this.onTouchMove)
this._scrollElement.removeEventListener('touchend', this.onTouchEnd)
this._scrollElement.removeEventListener('mousedown', this.onTouchStart)
this._scrollElement.removeEventListener('mousemove', this.onTouchMove)
this._scrollElement.removeEventListener('mouseleave', this.onTouchEnd)
this._scrollElement.removeEventListener('mouseup', this.onTouchEnd)
return this
}
render(children) {
reset() {
this.dbg(`Resetting channel`);
this.requestHandlers = {};
allOff(this.emitter);
return this;
}
};
stop () {
allOff(this)
}