@trudb/tru-common-lib 0.0.482 → 0.0.484
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5609,19 +5609,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImpor
|
|
|
5609
5609
|
|
|
5610
5610
|
const connection = new signalR.HubConnectionBuilder()
|
|
5611
5611
|
.withUrl("https://localhost:44476/notificationhub", {
|
|
5612
|
-
skipNegotiation: true
|
|
5613
|
-
transport: signalR.HttpTransportType.WebSockets
|
|
5612
|
+
skipNegotiation: true
|
|
5614
5613
|
})
|
|
5615
5614
|
.withAutomaticReconnect()
|
|
5616
5615
|
.build();
|
|
5617
5616
|
class TruConnectionHub {
|
|
5618
5617
|
constructor() {
|
|
5619
5618
|
this.start = async () => {
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5619
|
+
try {
|
|
5620
|
+
await connection.start().then(() => {
|
|
5621
|
+
console.log(`SignalR connection success! connectionId: ${connection.connectionId}`);
|
|
5622
|
+
connection.on("change", (value) => {
|
|
5623
|
+
console.log(JSON.parse(value));
|
|
5624
|
+
});
|
|
5625
|
+
});
|
|
5626
|
+
}
|
|
5627
|
+
catch (error) {
|
|
5628
|
+
console.log(`SignalR connection error: ${error}`);
|
|
5629
|
+
}
|
|
5625
5630
|
};
|
|
5626
5631
|
}
|
|
5627
5632
|
}
|