function accumulate(event, delay = 0, disposable) {
        return Event.debounce(event, (last, e) => {
            if (!last) {
                return [e];
            }
            last.push(e);
            return last;
        }, delay, undefined, true, undefined, disposable);
    }
Debounces an event, firing after some delay (default=0) with an array of all event original objects.

*NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned
event is accessible to "third parties", e.g the event is a public property. Otherwise a leaked listener on the
returned event causes this utility to leak a listener on the original event.