Provides an event hook for subscribing to and triggering events.
The type of the parameter that event callbacks receive.
An object with methods to subscribe to, unsubscribe from, and trigger the event.
const hook = useEventHook<string>() hook.on((message) => { console.log('Event received:', message) }) hook.trigger('Hello, world!') hook.off() Copy
const hook = useEventHook<string>() hook.on((message) => { console.log('Event received:', message) }) hook.trigger('Hello, world!') hook.off()
Provides an event hook for subscribing to and triggering events.