useEventBusDispatcher

Use the FireflyRuntime instance event bus to dispatch an event.

Reference

const dispatch = useEventBusDispatcher()

Parameters

None

Returns

A dispatch function. The event name must be a key augmented in EventMap. The payload type is inferred from the event name.

Usage

import { useEventBusDispatcher } from "@squide/firefly";

const dispatch = useEventBusDispatcher();

dispatch("show-toast", "Hello!");