Create a stable emitter function pre-bound to a specific event.
The returned function is stable across re-renders (via useCallback) because the bus instance and event name are constant for the provider's lifetime.
useCallback
The event name to emit.
A function that accepts a payload and emits the event.
const emitSave = useEmitter('save');emitSave({ id: 1 }); Copy
const emitSave = useEmitter('save');emitSave({ id: 1 });
Create a stable emitter function pre-bound to a specific event.
The returned function is stable across re-renders (via
useCallback) because the bus instance and event name are constant for the provider's lifetime.