function Scheduler(eventBus) {

  /**
   * @type { Record<string, ScheduledTask> }
   */
  this._scheduled = {};

  eventBus.on('diagram.destroy', () => {
    Object.keys(this._scheduled).forEach(id => {
      this.cancel(id);
    });
  });
}
A utility that allows you to schedule async tasks.

@class
@constructor

@param { import('../core/EventBus').default } eventBus