@trudb/tru-common-lib 0.0.478 → 0.0.480
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.
- package/esm2020/lib/services/tru-connection-hub.mjs +10 -16
- package/fesm2015/trudb-tru-common-lib.mjs +9 -14
- package/fesm2015/trudb-tru-common-lib.mjs.map +1 -1
- package/fesm2020/trudb-tru-common-lib.mjs +9 -15
- package/fesm2020/trudb-tru-common-lib.mjs.map +1 -1
- package/lib/services/tru-connection-hub.d.ts +1 -0
- package/package.json +1 -1
|
@@ -5608,24 +5608,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImpor
|
|
|
5608
5608
|
}] });
|
|
5609
5609
|
|
|
5610
5610
|
const connection = new signalR.HubConnectionBuilder()
|
|
5611
|
-
.withUrl("/
|
|
5611
|
+
.withUrl("/notificationhub")
|
|
5612
|
+
.withAutomaticReconnect()
|
|
5612
5613
|
.build();
|
|
5613
5614
|
class TruConnectionHub {
|
|
5614
5615
|
constructor() {
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
console.log("connection started");
|
|
5623
|
-
}).catch(err => console.log(err));
|
|
5624
|
-
}, 5000);
|
|
5625
|
-
});
|
|
5626
|
-
connection.on("change", (value) => {
|
|
5627
|
-
console.log(JSON.parse(value));
|
|
5628
|
-
});
|
|
5616
|
+
this.start = async () => {
|
|
5617
|
+
await connection.start();
|
|
5618
|
+
console.log(`SignalR connection success! connectionId: ${connection.connectionId}`);
|
|
5619
|
+
connection.on("change", (value) => {
|
|
5620
|
+
console.log(JSON.parse(value));
|
|
5621
|
+
});
|
|
5622
|
+
};
|
|
5629
5623
|
}
|
|
5630
5624
|
}
|
|
5631
5625
|
TruConnectionHub.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruConnectionHub, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|