Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_cleanup(sseId, timeoutId, onComplete, onError, err) {
sseService.removeHandler(sseId);
clearTimeout(timeoutId);
loadingIndicator.hide();
if (err && onError) {
onError(err);
} else {
onComplete();
}
}
_cleanupListeners() {
if (this._sseSubscribeId || this._sseTimeoutId) {
LOGGER.debug('cleaning up existing SSE listeners');
}
if (this._sseSubscribeId) {
sseService.removeHandler(this._sseSubscribeId);
this._sseSubscribeId = null;
}
if (this._sseTimeoutId) {
clearTimeout(this._sseTimeoutId);
this._sseTimeoutId = null;
}
}
_cleanupListeners() {
if (this._sseSubscribeId || this._sseTimeoutId) {
LOGGER.debug('cleaning up existing SSE listeners');
}
if (this._sseSubscribeId) {
sseService.removeHandler(this._sseSubscribeId);
this._sseSubscribeId = null;
}
if (this._sseTimeoutId) {
clearTimeout(this._sseTimeoutId);
this._sseTimeoutId = null;
}
}
_cleanupListeners() {
if (this._sseSubscribeId) {
sseService.removeHandler(this._sseSubscribeId);
this._sseSubscribeId = null;
}
}