Subscribe to type. Returns an unsubscribe thunk that callers
should store (e.g., in an EventGroup or a dispose() list).
replayLast: true causes the last emitted payload for type,
if any, to fire immediately on subscription. Useful for
late-binding panels that need the current value (e.g., FPS
counter that wants to show something before the next frame).
Whether at least one listener is currently subscribed to type.
Lets producers gate expensive work behind "anyone consuming?"
(e.g. GPU picking only runs when a selection listener exists).
Drop all subscribers (or just those for type). Used by tests
that share the singleton between cases. Production code should
use the per-subscription unsubscribe instead.
Optionaltype: keyof EventMap
The typed pub/sub surface.