Say there are random sequences of external actions (for example, scroll events). I need to immediately process the first action, and then undo all the actions that occurred at intervals shorter than any given delta, and then process the next, which should be delayed for this delta. Further actions should be handled in the same way.
This is like a combination of debounce-immediate and simple debounce. I prepared a chart to demonstrate this idea.

What is the best solution / approach here? I wonder if there is a ready-made template ...
UPDATE
I would like to thank all the participants! For research, I created a plunker with fourfive different implementations proposed in the answers: https://plnkr.co/N9nAwQ .
const handler = [
processEvent,
debounceNext(processEvent, DELAY),
makeRateLimitedEventHandler(DELAY, processEvent),
debounceWithDelay(processEvent, DELAY, 0),
_.debounce(processEvent, DELAY, {leading: true})
debounceish(DELAY, processEvent)
];
The great news was that Lodash had a deb deb-debug implementation that satisfies this problem (thanks to Willem D'Aseler). And here is a great demonstration from Mikk3lRo's answer, it also provided some useful synthesis.
: form only ... , okey. , ultima . ES6 ( Plunker), . ( , , , ). timestamp ! postDelay , ( lodash).
lodash ( lodash debounce ), debounceish
by Mikk3lRo.
PS ( , ) ( 200, , 100). ... Nevermind.