mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-15 22:52:36 +03:00
OP-2481 Cleanup
This commit is contained in:
@@ -144,7 +144,7 @@ const isSubType = (subType: string): subType is keyof Subscription => Object.val
|
||||
class OrionAggregatorWS {
|
||||
private ws: WebSocket | undefined;
|
||||
|
||||
private isClosedIntentionally: boolean = false;
|
||||
private isClosedIntentionally = false;
|
||||
|
||||
private subscriptions: Partial<{
|
||||
[K in keyof Subscription]: Partial<Record<string, Subscription[K]>>
|
||||
@@ -263,7 +263,7 @@ class OrionAggregatorWS {
|
||||
|
||||
init(isReconnect = false) {
|
||||
this.ws = new WebSocket(this.wsUrl);
|
||||
this.ws.onclose = (e) => {
|
||||
this.ws.onclose = () => {
|
||||
if (!this.isClosedIntentionally) this.init(true);
|
||||
};
|
||||
this.ws.onopen = () => {
|
||||
|
||||
@@ -74,7 +74,7 @@ export default class PriceFeedSubscription<T extends SubscriptionType = Subscrip
|
||||
|
||||
readonly type: T;
|
||||
|
||||
private isClosedIntentionally: boolean = false;
|
||||
private isClosedIntentionally = false;
|
||||
|
||||
constructor(
|
||||
type: T,
|
||||
@@ -108,7 +108,7 @@ export default class PriceFeedSubscription<T extends SubscriptionType = Subscrip
|
||||
this.callback(parseResult.data);
|
||||
};
|
||||
|
||||
this.ws.onclose = (e) => {
|
||||
this.ws.onclose = () => {
|
||||
if (this.heartbeatInterval) clearInterval(this.heartbeatInterval);
|
||||
if (!this.isClosedIntentionally) this.init();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user