websocket-ts
Advanced tools
Comparing version 2.1.4 to 2.1.5
@@ -407,2 +407,3 @@ "use strict"; | ||
} | ||
// handler dispatches the retry event to all listeners of the retry event-type | ||
var handleRetryEvent = function (detail) { | ||
@@ -423,3 +424,3 @@ var event = new CustomEvent(websocket_event_1.WebsocketEvent.retry, { detail: detail }); | ||
retryEventDetail.retries <= this._options.retry.maxRetries) { | ||
this.retryTimeout = window.setTimeout(function () { return handleRetryEvent(retryEventDetail); }, retryEventDetail.backoff); | ||
this.retryTimeout = globalThis.setTimeout(function () { return handleRetryEvent(retryEventDetail); }, retryEventDetail.backoff); | ||
} | ||
@@ -431,3 +432,3 @@ }; | ||
Websocket.prototype.cancelScheduledConnectionRetry = function () { | ||
window.clearTimeout(this.retryTimeout); | ||
globalThis.clearTimeout(this.retryTimeout); | ||
}; | ||
@@ -434,0 +435,0 @@ return Websocket; |
@@ -331,2 +331,3 @@ import { WebsocketEvent, } from "./websocket_event"; | ||
} | ||
// handler dispatches the retry event to all listeners of the retry event-type | ||
const handleRetryEvent = (detail) => { | ||
@@ -347,3 +348,3 @@ const event = new CustomEvent(WebsocketEvent.retry, { detail }); | ||
retryEventDetail.retries <= this._options.retry.maxRetries) { | ||
this.retryTimeout = window.setTimeout(() => handleRetryEvent(retryEventDetail), retryEventDetail.backoff); | ||
this.retryTimeout = globalThis.setTimeout(() => handleRetryEvent(retryEventDetail), retryEventDetail.backoff); | ||
} | ||
@@ -355,5 +356,5 @@ } | ||
cancelScheduledConnectionRetry() { | ||
window.clearTimeout(this.retryTimeout); | ||
globalThis.clearTimeout(this.retryTimeout); | ||
} | ||
} | ||
//# sourceMappingURL=websocket.js.map |
{ | ||
"name": "websocket-ts", | ||
"version": "2.1.4", | ||
"version": "2.1.5", | ||
"main": "dist/cjs/src/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/cjs/src/index.d.ts", |
@@ -25,3 +25,3 @@ import { Backoff } from "./backoff/backoff"; | ||
private _underlyingWebsocket: WebSocket; // the underlying websocket, e.g. native browser websocket | ||
private retryTimeout?: number; // timeout for the next retry, if any | ||
private retryTimeout?: ReturnType<typeof globalThis.setTimeout>; // timeout for the next retry, if any | ||
@@ -451,2 +451,3 @@ private _options: WebsocketOptions & | ||
// handler dispatches the retry event to all listeners of the retry event-type | ||
const handleRetryEvent = (detail: RetryEventDetail) => { | ||
@@ -476,3 +477,3 @@ const event: CustomEvent<RetryEventDetail> = new CustomEvent( | ||
) { | ||
this.retryTimeout = window.setTimeout( | ||
this.retryTimeout = globalThis.setTimeout( | ||
() => handleRetryEvent(retryEventDetail), | ||
@@ -488,4 +489,4 @@ retryEventDetail.backoff, | ||
private cancelScheduledConnectionRetry() { | ||
window.clearTimeout(this.retryTimeout); | ||
globalThis.clearTimeout(this.retryTimeout); | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
250797
4598