Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

emitEvent

emitEvent<Record, Delivery, Scope>(source, event, …rest): void

Emits event: one event, delivered once to each system and once to each view that listens, in the order emitted, and two emits are never merged. The record is copied as it is emitted, each field left out at its default. An outcome takes an authority: the room’s step, inside if (step.authoritative) or in a system with no runsOn; requireAuthority(world) between steps; or findAuthority(world, entity) for an entity only this page holds. A local event takes the world that draws, outside any step: emitEvent(step, DamagedEvent, { amount: 12 }, { entity: target }).

Type Parameter
Record
Delivery extends EventDelivery
Scope extends EventScope
Parameter Type
source EmitSource<Delivery, Scope>
event EventHandle<Record, Delivery, Scope>
…rest EmitArguments<Record, Delivery, Scope>

void