Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

NiceRelaySub

import type { NiceRelaySub } from "https://gitlab.com/soapbox-pub/nostr-machina/-/raw/main/mod.ts";

Relay subscription interface. Loop over it to get events.

@example
for await (const event of sub) {
  console.log(event);
}
interface NiceRelaySub <K extends number> {
[[Symbol.asyncIterator]]: () => AsyncGenerator<Event<K>>;
close: () => void;
eoseSignal: AbortSignal;
id: string;
}

§Type Parameters

§
K extends number
[src]

§Properties

§
[[Symbol.asyncIterator]]: () => AsyncGenerator<Event<K>>
[src]
§
close: () => void
[src]

Close the subscription.

§
eoseSignal: AbortSignal
[src]

Signal that gets aborted when an EOSE message is received for this subscription.

@example
sub.eoseSignal.onabort = () => sub.close();

for await (const event of sub) {
  console.log(event);
}
§
id: string
[src]

ID of the subscription.