Events
Emitting an event
Subscribing to an event
Programs can subscribe an action to handle an event. When an event is emitted, the action will be invoked with an additional parameter called event
.
import type { import nodes
nodes } from "membrane";
export async function function sendToSlack(_: any, { event }: { event: any;}): Promise<void>
sendToSlack(_: any
_, { event: any
event }) { await import nodes
nodes.any
slack.any
channel(/* ... */).any
sendMessage(/* ... */);}
export async function function configure(): Promise<void>
configure() { import nodes
nodes.any
ghWebhookReceived.any
$subscribe(function sendToSlack(_: any, { event }: { event: any;}): Promise<void>
sendToSlack);}