pond-ts API Reference (core)
    Preparing search index...

    Type Alias Trigger

    A Trigger describes when an accumulator should emit. Pond's live layer factors emission cadence as a first-class concept — orthogonal to the accumulator's aggregation choice — so the same primitive can fire on every event, on sequence boundaries, or (in future) on count thresholds.

    Triggers are constructed via the Trigger factory:

    import { Trigger, Sequence } from 'pond-ts';

    const event = Trigger.event(); // per-event (default)
    const tick = Trigger.every('30s'); // sugar: fixed cadence
    const clock = Trigger.clock(Sequence.every('30s')); // explicit Sequence form

    Pass to an accumulator's trigger option to switch its emission cadence:

    live.rolling('1m', { latency: 'p95' }, {
    trigger: Trigger.every('30s'),
    });

    For partitioned accumulators, a clock trigger synchronises emission across all partitions: when any partition's event crosses a boundary, every partition emits its current rolling-window snapshot at the same boundary timestamp.