API Reference
toTopic()
Creates a to topic.
Import
import { toTopic } from "@graphrefly/ts/messaging";
Signature
function toTopic(
graph: Graph,
source: Node<T>,
bus: MessageBus<TTopic>,
topic: TTopic | string,
opts: ToTopicOptions = {},
): ToTopicBundle<T>
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
The to topic result.
Example
import { toTopic } from "@graphrefly/ts/messaging";
Source
packages/ts/src/messaging/index.ts