From 44b9842ea9bffb0157c8f5000dec68e0ece8b4c1 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sat, 18 Mar 2023 13:55:33 -0400 Subject: [PATCH] *add dht getter that returns a mock object including ready --- src/index.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/index.ts b/src/index.ts index 6707a27..8300e60 100644 --- a/src/index.ts +++ b/src/index.ts @@ -18,6 +18,15 @@ export class SwarmClient extends Client { private _topics: Set = new Set(); + get dht() { + const self = this; + return { + async ready() { + return self.ready(); + }, + }; + } + constructor(useDefaultDht = true, autoReconnect = false) { super(); this.useDefaultSwarm = useDefaultDht;