他首先会遍历enableRegistry取出其中定义的模块,并且将没有加载成功的模块标识注入noLoads数组,如果过期了这里就会报错

如果上述没问题还会做循环依赖的判断,主要逻辑在breakCycle中,因为我们这里不存在循环依赖便跳出了,但还未结束

我们这里开始了递归检测依赖是否载入

if ((!expired || usingPathFallback) && stillLoading) {
  //Something is still waiting to load. Wait for it, but only
  //if a timeout is not already in effect.
  if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) {
    checkLoadedTimeoutId = setTimeout(function () {
      checkLoadedTimeoutId = 0;
      checkLoaded();
    }, 50);
  }
}

 

相关文章:

  • 2022-12-23
  • 2021-05-28
  • 2022-02-07
  • 2021-12-24
  • 2021-08-14
  • 2021-05-28
  • 2021-12-12
猜你喜欢
  • 2021-04-07
  • 2021-06-27
  • 2022-12-23
  • 2021-10-16
  • 2021-05-19
  • 2021-09-21
相关资源
相似解决方案