Reactions & Triggers

When this happens, do that — the page's only rule primitive, plus the per-clip triggers in the timeline.

Sequencing safely, and the caps that stop a runaway.

Every reaction carries a delay. With delay 0 the action runs on a microtask, decoupled from the store's own watcher stack; with a delay it lands on a timer. Chain reactions by having one emit an event another listens for, or by reacting to a clip ending.

The two caps

GuardLimitCatches
Burst cap256 actions per macrotask turnA synchronous loop: setStore → onChange → setStore.
Rate cap512 actions per rolling secondA slower self-feeding cascade whose delay puts each iteration in its own turn.

Over either cap the action is dropped and logged until the window advances. Emitting is charged too — without that, onEvent(e) → emit(e) would loop forever through the bus.

A chained reaction with a delay.
A chained reaction with a delay.