scheduleRenderTask = async () => {
    if (!queuePromise) {
      queuePromise = new Promise(resolve => {
        window.requestAnimationFrame(() => {
          // Render all components in the queue
          // console.log(`--------------------RENDER TASK START------------------------------`); // eslint-disable-line
          invalidatedWebComponents.process(renderImmediately);
          // console.log(`--------------------RENDER TASK END------------------------------`); // eslint-disable-line
          // Resolve the promise so that callers of renderDeferred can continue
          queuePromise = null;
          resolve();
          // Wait for Mutation observer before the render task is considered finished
          if (!mutationObserverTimer) {
            mutationObserverTimer = setTimeout(() => {
              mutationObserverTimer = undefined;
              if (invalidatedWebComponents.isEmpty()) {
                _resolveTaskPromise();
              }
            }, 200);
          }
        });
      });
    }
    await queuePromise;
  }
Schedules a rendering task, if not scheduled already