Collapses a burst of calls into a single delayed one.

Each trigger() restarts the timer, so the action runs delayMs after things go quiet — the right behaviour for saving state after a flurry of inventory changes, or refreshing a UI while a slider is being dragged.

Constructor

new(delayMs:Int, action:() ‑> Void)

Variables

Methods

cancel():Void

Drops the pending action without running it.

flush():Void

Runs the pending action immediately, if there is one.

trigger():Void

Schedules the action, cancelling any run that was already pending.