live watch hubs Set and schedule connections

This commit is contained in:
Andre Staltz 2024-02-06 14:53:22 +02:00
parent f5545fd7d9
commit 809d3e774b
No known key found for this signature in database
GPG Key ID: 9EDE23EA7E8A4890
1 changed files with 6 additions and 0 deletions

View File

@ -64,6 +64,12 @@ class Scheduler {
for (const multiaddr of multiaddrs) { for (const multiaddr of multiaddrs) {
this.#scheduleWithHub(multiaddr) this.#scheduleWithHub(multiaddr)
} }
// @ts-ignore
const stopWatch = this.#peer.set?.watch(({subdomain, event, value}) => {
if (subdomain === 'hubs' && event === 'add') {
this.#scheduleWithHub(value)
}
});
} }
start() { start() {