Sanity Library Reference Docs
    Preparing search index...
    • Pick one beat's catch-up: every effect in effectNames without a declared budget, plus one of budgetedEffectNames, whose turn the beat's own clock decides, spreading the turns so that beats arriving every nth slot rather than every slot still reach each budgeted effect. One invocation registers at most one budgeted handler.

      Throws when effectNames is empty, when registry holds no handler for a name in effectNames, when a budgetedEffectNames entry is not in effectNames, when afterMs is not a positive finite number, or, when it is selecting a budgeted effect, when clock returns a value that is not an instant. afterMs is one beat in milliseconds and also the period the budgeted turn rotates over, so widening the recovery window slows that rotation by the same factor. clock defaults to the wall clock. Pass the result straight through: handlers to the engine's effects with missingHandler: 'skip', and args as catchUp.

      Parameters

      • args: {
            afterMs: number;
            budgetedEffectNames: readonly string[];
            clock?: Clock;
            effectNames: readonly string[];
            recoverDefinitions: readonly string[];
            registry: Readonly<Record<string, EffectHandler>>;
        }

      Returns BeatCatchUp