Event Bus
Event Bus
qti-clockwork-events provides typed buffered and immediate event channels.
Core API
send(event)orsend(type, event)sendImmediate(event)orsendImmediate(type, event)listen(type): Events<T>on(type, listener): unsubscribeclear(type?)
Buffered vs Immediate
sendappends to per-type buffersendImmediateinvokes listeners instantly and does not buffer
Type Inference Rules
Implicit type inference only works for non-primitive class-instance events.
For primitives/plain objects use explicit channel:
events.send(DamageSymbol, { target: 1, amount: 5 })
Events Snapshot
Events<T> is immutable for a read call and exposes:
iter()isEmpty()len()