From 289dbcd52365c78a068db8823d1e176724a1b43d Mon Sep 17 00:00:00 2001 From: ennmichael Date: Mon, 27 Feb 2023 00:25:11 +0100 Subject: [PATCH] finishing touches --- packages/nostr/NOTES.md | 2 -- packages/nostr/src/client/conn.ts | 4 +++- packages/nostr/src/client/index.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 packages/nostr/NOTES.md diff --git a/packages/nostr/NOTES.md b/packages/nostr/NOTES.md deleted file mode 100644 index 7db31fa..0000000 --- a/packages/nostr/NOTES.md +++ /dev/null @@ -1,2 +0,0 @@ -- Don't use arrays for callbacks because there's no way to clear them, -passing undefined or null to on* should clear the callback diff --git a/packages/nostr/src/client/conn.ts b/packages/nostr/src/client/conn.ts index 75ff313..4e3f330 100644 --- a/packages/nostr/src/client/conn.ts +++ b/packages/nostr/src/client/conn.ts @@ -49,7 +49,9 @@ export class Conn { if (err instanceof ProtocolError) { this.#errorCallback?.(err) } else { - // TODO Not sure if this is the case? + // TODO Not sure if this is the best idea. + // Investigate what WebSocket does if the callback throws? + // Either way it seems like the best idea is to have `onError` called on all types of errors throw err } } diff --git a/packages/nostr/src/client/index.ts b/packages/nostr/src/client/index.ts index 2fd7058..b07fa16 100644 --- a/packages/nostr/src/client/index.ts +++ b/packages/nostr/src/client/index.ts @@ -226,7 +226,7 @@ interface ConnState { */ auth: boolean /** - * Should this connection be used for receiving messages? + * Should this connection be used for receiving events? */ read: boolean /**