From f9748d9cc33e321b136ab1f344469464a7bfd3bd Mon Sep 17 00:00:00 2001 From: Roland Bewick Date: Thu, 16 Feb 2023 20:53:52 +0700 Subject: [PATCH] doc: fix order of commands to connect to relay --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1124b5a..522d454 100644 --- a/README.md +++ b/README.md @@ -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([ {