UNPKG

@magicbell/react-headless

Version:

Hooks to build a notification inbox

14 lines (13 loc) 398 B
import { EventSource } from '../lib/realtime.js'; interface HookOptions { source: EventSource | 'any'; } /** * React hook to listen to events. * * @param event Name of the event * @param handler Callback function * @param options */ export default function useMagicBellEvent(event: string, handler: (data?: unknown, source?: EventSource) => void, options?: HookOptions): void; export {};