当前位置:网站首页>【疑问】最终推荐的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
边栏推荐
猜你喜欢

How to save a section of pages in a PDF as a new PDF file

PyQt5_pyqtgraph鼠标在折线图上画方形

安装部署 Kubernetes 仪表板(Dashboard)

论文速读:Homography Loss for Monocular 3D Object Detection

7亿听众背后的在线音频掘金故事

The line chart with square PyQt5_pyqtgraph mouse

【C语言程序】求直角三角形边长

通关剑指 Offer——剑指 Offer II 008. 和大于等于 target 的最短子数组

讯飞AIUI智能机器人5-----让器理解你(语音技术综合应用)

压缩包密码如何快速删除?
随机推荐
HyperLynx中层叠设计实例
力扣练习——单词搜索
【FreeRTOS】12 任务通知——更省资源的同步方式
七月阅读:《刘慈欣科幻短篇小说集Ⅰ》笔记
DOM系列之 click 延时解决方案
斐波那契数列
地牢大师(DAY 95)
找倍数(DAY 98)
安装部署 Kubernetes 仪表板(Dashboard)
洛谷P2437蜜蜂路线
ADSP21489仿真:Failed to set breakpoint: Can‘t set breakpoints in the current state: Running
力扣 剑指 Offer 56 - I. 数组中数字出现的次数
CODESYS指针型变量编程应用(配方)
力扣练习——48 找到小镇的法官
redis基础入门
UI自动化测试框架搭建——标记性能较差用例
投资组合分析:portfolio_analysis.Tangenvy_portfolio(切点组合)
nr部分计算
JDBC再回顾
PyQt5_pyqtgraph mouse draws straight lines on line charts