toTopic()
Creates a to topic.
Import
Section titled “Import”import { toTopic } from "@graphrefly/ts/messaging";Signature
Section titled “Signature”function toTopic( graph: Graph, source: Node<T>, bus: MessageBus<TTopic>, topic: TTopic | string, opts: ToTopicOptions = {},): ToTopicBundle<T>Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
graph | Graph | Graph that owns the created nodes or projector. |
source | Node<T> | Source node that provides graph-visible input. |
bus | MessageBus<TTopic> | bus value used by the helper. |
topic | TTopic | string | topic value used by the helper. |
opts | ToTopicOptions | Options that configure the helper. |
Returns
Section titled “Returns”The to topic result.
Example
Section titled “Example”import { toTopic } from "@graphrefly/ts/messaging";Source
Section titled “Source”packages/ts/src/messaging/index.ts