mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-08 16:28:49 +00:00
correctly wait until connection to a relay is established
This commit is contained in:
4
relay.ts
4
relay.ts
@@ -7,9 +7,9 @@ import { Queue, normalizeURL } from './utils.ts'
|
||||
import { nip42 } from './index.ts'
|
||||
import { yieldThread } from './helpers.ts'
|
||||
|
||||
export function relayConnect(url: string) {
|
||||
export async function relayConnect(url: string) {
|
||||
const relay = new Relay(url)
|
||||
relay.connect()
|
||||
await relay.connect()
|
||||
return relay
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user