GraphReFlyTS

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

ParameterTypeDescription
graphGraphGraph that owns the created nodes or projector.
sourceNode<T>Source node that provides graph-visible input.
busMessageBus<TTopic>bus value used by the helper.
topicTTopic | stringtopic value used by the helper.
optsToTopicOptionsOptions that configure the helper.

Returns

The to topic result.

Example

import { toTopic } from "@graphrefly/ts/messaging";

Source

packages/ts/src/messaging/index.ts