docs: function enqueueTask(fn) {
    let id = nextTaskId++;
    let handle = null;
    pendingTasks[id] = () => {
      if (id in pendingTasks) {
        fn.apply(null, arguments);
        clearImmediate(handle);
        delete pendingTasks[id];
      }
    };
    handle = setImmediate(pendingTasks[id]);
  }