当前位置:网站首页>【疑问】最终推荐的loose pattern 如果依赖module 没有加载完毕,行为如何,是否报错
【疑问】最终推荐的loose pattern 如果依赖module 没有加载完毕,行为如何,是否报错
2022-08-02 04:25:00 【zsy_1991】
Loose Augmentation
While our example above requires our initial module creation to be first, and the augmentation to happen second, that isn’t always necessary. One of the best things a JavaScript application can do for performance is to load scripts asynchronously. We can create flexible multi-part modules that can load themselves in any order with loose augmentation. Each file should have the following structure:
var MODULE = (function (my) {
// add capabilities...
return my;
}(MODULE || {
}));
In this pattern, the var statement is always necessary. Note that the import will create the module if it does not already exist. This means you can use a tool like LABjs and load all of your module files in parallel, without needing to block.
Refrence
边栏推荐
- 使用pycharm debug 深度学习代码
- Platts Analysis-MATLAB Toolbox Function
- 力扣练习——43 路径总和
- Scala basics [common method supplement, pattern matching]
- [Errno 13] Permission denied:’/usr/local/share/jupyter’
- LeetCode 23: 合并K个升序链表
- redis基础入门
- Deep blue college - handwritten VIO operations - the first chapter
- falco 【1】入门
- 2022 Huawei Software Elite Challenge (Preliminary) - Summary
猜你喜欢
【C语言程序】求直角三角形边长
轮询和长轮询的区别
ScholarOne Manuscripts submits journal LaTeX file and cannot convert PDF successfully!
Arduino框架下STM32F1/F4系列HID模式程序烧录教程
PyQt5_pyqtgraph鼠标在折线图上画方形
What if some fields don't want to be serialized?
LeetCode 23: 合并K个升序链表
How to save a section of pages in a PDF as a new PDF file
浅学一下二叉树的顺序存储结构——堆
ADSP21489工程中LDF文件配置详解
随机推荐
找倍数(DAY 98)
CODESYS指针型变量编程应用(配方)
CaDDN code debugging
Liquidated damages are too high"
热爱和责任
关于地图GIS开发事项的一次实践整理(上)
爬虫_爬取wasde月度供需平衡表(实例)
OpenPCDet environment configuration of 3 d object detection and demo test
internship:数据库表和建立的实体类及对应的枚举类之间的联系示例
热爱责任担当
高等数学(第七版)同济大学 总习题三(前10题) 个人解答
批量--10---根据set数拆分文件
Batch normalization (BN) based on deep learning
关于地图GIS的一次实践整理(下) Redis的GIS实践
力扣练习——43 路径总和
ADSP21489工程中LDF文件配置详解
日本痴汉打赏女主播1.5亿,结果。。。
学内核之五:问题一,关于上下文切换
七月阅读:《刘慈欣科幻短篇小说集Ⅰ》笔记
Scala basics [common method supplement, pattern matching]