@waves.exchange/config-ws
Advanced tools
Comparing version 0.0.6 to 0.0.8
@@ -69,9 +69,3 @@ "use strict"; | ||
this.ensureConfigWebSocket()); | ||
const oldConfigs = this.configSubject.getValue().configs; | ||
if (!(filePath in oldConfigs)) { | ||
this.configSubject.next({ | ||
configs: Object.assign(Object.assign({}, oldConfigs), { [filePath]: undefined }) | ||
}); | ||
} | ||
ws.multiplex(() => ({ type: 'subscribe', topic }), () => ({ type: 'unsubscribe', topic }), (message) => message.topic === topic && message.type === 'update').subscribe(data => { | ||
ws.multiplex(() => ({ type: 'subscribe', topic }), () => ({ type: 'unsubscribe', topic }), (message) => message.topic === topic && (message.type === 'update' || message.type === 'subscribed')).subscribe(data => { | ||
const oldConfigs = this.configSubject.getValue().configs; | ||
@@ -78,0 +72,0 @@ this.configSubject.next({ |
@@ -36,3 +36,3 @@ export declare type PingUpdate = { | ||
export declare type SubscribeMessage = { | ||
type: 'subscribe' | 'unsubscribe'; | ||
type: 'subscribe' | 'unsubscribe' | 'subscribed' | 'unsubscribed'; | ||
topic: string; | ||
@@ -42,4 +42,4 @@ value?: undefined; | ||
export declare type ConfigState = { | ||
configs: Record<string, Record<any, any> | undefined>; | ||
configs: Record<string, Record<any, any>>; | ||
}; | ||
//# sourceMappingURL=types.d.ts.map |
{ | ||
"name": "@waves.exchange/config-ws", | ||
"version": "0.0.6", | ||
"version": "0.0.8", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "typings": "dist/index.d.ts", |
@@ -90,17 +90,7 @@ import { WebSocketSubject, webSocket, BehaviorSubject } from '@waves.exchange/reactive'; | ||
const oldConfigs = this.configSubject.getValue().configs; | ||
if (!(filePath in oldConfigs)) { | ||
this.configSubject.next({ | ||
configs: { | ||
...oldConfigs, | ||
[filePath]: undefined | ||
} | ||
}); | ||
} | ||
ws.multiplex( | ||
() => ({ type: 'subscribe', topic }), | ||
() => ({ type: 'unsubscribe', topic }), | ||
(message): message is ContentUpdate => message.topic === topic && message.type === 'update', | ||
(message): message is ContentUpdate => | ||
message.topic === topic && (message.type === 'update' || message.type === 'subscribed'), | ||
).subscribe(data => { | ||
@@ -107,0 +97,0 @@ const oldConfigs = this.configSubject.getValue().configs; |
@@ -44,3 +44,3 @@ | ||
export type SubscribeMessage = { | ||
type: 'subscribe' | 'unsubscribe'; | ||
type: 'subscribe' | 'unsubscribe' | 'subscribed' | 'unsubscribed'; | ||
topic: string; | ||
@@ -51,2 +51,2 @@ value?: undefined; | ||
export type ConfigState = { configs: Record<string, Record<any, any> | undefined> }; | ||
export type ConfigState = { configs: Record<string, Record<any, any>> }; |
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
15396
277