Creates a new Topic that can be used to publish or subscribe to messages.
A human-readable name for the topic, useful for debugging and logging.
The broadcasting direction for the topic. children by default.
children
const EnvTopic = createTopic<string>("Env");messageBus.subscribe(EnvTopic, (data) => console.log(data));messageBus.publish(EnvTopic, "production"); // => 'production' logged to the console Copy
const EnvTopic = createTopic<string>("Env");messageBus.subscribe(EnvTopic, (data) => console.log(data));messageBus.publish(EnvTopic, "production"); // => 'production' logged to the console
Creates a new Topic that can be used to publish or subscribe to messages.