queueMicrotask & EventLoop & macrotask & microtask
2024-10-19 05:42:38
queueMicrotask
https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/queueMicrotask
scope.queueMicrotask(function);
https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#microtask-queuing
self.queueMicrotask(() => {
// function contents here
})
MyElement.prototype.loadData = function (url) {
if (this._cache[url]) {
queueMicrotask(() => {
this._setData(this._cache[url]);
this.dispatchEvent(new Event("load"));
});
} else {
fetch(url).then(res => res.arrayBuffer()).then(data => {
this._cache[url] = data;
this._setData(data);
this.dispatchEvent(new Event("load"));
});
}
};
https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide
macrotask & microtask
https://javascript.info/event-loop
https://zh.javascript.info/event-loop
浅析JS堆、栈、执行栈 和 EventLoop
https://mp.weixin.qq.com/s/Vydvo1PVGgr9zGbYsubX5w
Event loops 秒懂
https://github.com/wangmeijian/blog/blob/master/docs/Event loops秒懂.md
宏任务 task & 微任务 microtask
https://zh.javascript.info/event-loop
https://zh.javascript.info/microtask-queue
critical-rendering-path
前端性能优化
xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
最新文章
- D3.js学习(三)
- BigDecimal 加减乘除
- ubuntu安装erlang
- ngModel 值不更新/显示
- 士兵站队问题sol
- 转-CSS3 圆角(border-radius)
- 上架app 到app store 的出现: “The IPA is invalid. It does not inlude a Payload directory.”错误处理
- 编译器的未来——我们还需要C++么?
- Ubuntu 14.0操作系统,修改默认打开方式的方法
- Jquery实现图片左右滚动(自动)
- 在jdbc中使用properites文件进行使用
- [Swift]LeetCode622. 设计循环队列 | Design Circular Queue
- oracle总结--增删改查
- 006 python操作符
- LeetCode - 768. Max Chunks To Make Sorted II
- 通过django的rest-framework……(CBV)
- Mysql学习(一)添加一个新的用户并用golang操作Mysql
- [troubleshoot][archliunx][chromium][flash] chrome提示flash不是最新
- c#关于字符串格式化
- 674. Longest Continuous Increasing Subsequence
热门文章
- 获取当前文件路径 import 原理 一般把模块组成的集合称为包(package)
- vue组件中data为什么必须是一个函数?
- Excel 快速填充:填充柄+数据验证
- 用java实现word转pdf
- nginx常用功能和配置
- Hbase 表的设计原则 ————总结
- mysql高级day4
- OpenCV4.4.0 安装测试 Installation &; Examination (Ubuntu18.04, Ubuntu 20.04)
- Codeforces Round #547 (Div. 3) C. Polycarp Restores Permutation (数学)
- 一张图解决ThreadLocal