/* * The interface exposed by this class is designed to closely match the interface expected by * the `EventLog` component, so that you can do this: * * let capture = $state(new EventCapture()); * const someEvent = capture.on('someEvent'); * * // … * * */ export default class EventCapture { events = $state([]); on(event) { return (...args) => this.events.push({ event, args }); } clear() { this.events = []; } }