Relatude Help

Commands of your own

Send a module's own commands (chapter 18) with store.send(type, payload). Payloads and answers are camelCase JSON, so events.cancel, which reads CancelPayload.Id, takes { id }:

const { events } = await store.send<{ events: { id: string; name: string }[] }>('events.upcoming');
await store.send('events.cancel', { id: events[0].id });

send adds the store's context to the payload, as context. The commands command lists every command the server knows.