Skip to content

Welshman Docs / @welshman/app / Command

Class: Command ​

Defined in: command.ts:12

An event paired with the relays it's meant for, without committing to how it gets published. Plugin mutation methods (create/update/etc.) build the event and return a Command instead of publishing it directly, so the caller decides: publish() sends it through the normal Publisher pipeline, and publishToRelays(urls) targets a specific set of relays.

Constructors ​

Constructor ​

new Command(app, event, relays): Command

Defined in: command.ts:13

Parameters ​

app ​

IApp

event ​

EventTemplate

relays ​

string[]

Returns ​

Command

Properties ​

app ​

readonly app: IApp

Defined in: command.ts:14


event ​

readonly event: EventTemplate

Defined in: command.ts:15


relays ​

readonly relays: string[]

Defined in: command.ts:16

Methods ​

publish() ​

publish(): Publication

Defined in: command.ts:19

Returns ​

Publication


publishToRelays() ​

publishToRelays(urls): Publication

Defined in: command.ts:21

Parameters ​

urls ​

string[]

Returns ​

Publication