property WSEventBus.subscribe

Calls handler with each event of kind, until the returned call.

Type

<K extends keyof WSEvents>(
kind: K,
handler: (event: WSEvents[K]) => void
) => () => void

Usage

import { type WSEventBus } from "src/contexts/ws/WSContext.ts";