doc: fix order of commands to connect to relay

This commit is contained in:
Roland Bewick
2023-02-16 12:35:13 -03:00
committed by fiatjaf
parent 3a22dd3da6
commit f9748d9cc3
+2 -2
View File
@@ -60,8 +60,6 @@ import {
} from 'nostr-tools'
const relay = relayInit('wss://relay.example.com')
await relay.connect()
relay.on('connect', () => {
console.log(`connected to ${relay.url}`)
})
@@ -69,6 +67,8 @@ relay.on('error', () => {
console.log(`failed to connect to ${relay.url}`)
})
await relay.connect()
// let's query for an event that exists
let sub = relay.sub([
{