createCueBus
Shared store for fan-out. Pass bus to observeCue, then subscribe.
import { createCueBus, defineCue, observeCue } from 'motion-cues';
const bus = createCueBus();const FLOOD = defineCue("flood", { half: 0.5, full: 1 });
observeCue(progress, FLOOD, { bus });
bus.subscribe(() => { if (bus.has("flood", "half")) track("halfway"); if (bus.has("flood", "full")) startNextPhase();});bus.has("cue-name", "threshold"); // booleanbus.get("cue-name"); // { triggered: Set<string> }bus.reset("cue-name"); // clear triggered keysbus.subscribe(() => {}); // returns unsubscribe fn