code: function busyMonitor(publicAPI, model) {
    model.busyCounter = 0;
  
    const checkNotifyStatus = (delta) => {
      const lastCount = model.busyCounter;
      model.busyCounter += delta;
      if (model.busyCounter <= 0) {
        // not busy anymore
        publicAPI.fireBusyStatusChanged(false);
        model.busyCounter = 0;
      } else if (lastCount === 0 && model.busyCounter > 0) {
        // busy now, don't notify again with increased count
        publicAPI.fireBusyStatusChanged(true);
      }
    };
  
    const success = (args) => {
      checkNotifyStatus(-1);
      return Promise.resolve(args);
    };
  
    const error = (args) => {
      checkNotifyStatus(-1);
      return Promise.reject(args);
    };
  
    publicAPI.busy = (promise) => {
      checkNotifyStatus(1);
      return promise.then(success, error);
    };
  
    publicAPI.busyWrapFunction = (fn) => (...args) => publicAPI.busy(fn(...args));
  
    publicAPI.isBusy = () => model.busyCounter > 0;
  }
docs: ---------------------------------------------------------------------------- Busy Monitor ----------------------------------------------------------------------------