queueMicrotask & microtask All In One
queueMicrotask & microtask All In One
microtask
- microtask queue
Promise
Mutation Observer API
MutationObserver
突变观察者
macrotask
requestAnimationFrame
requestIdleCallback ???
setInterval
setTimeout
Web APIs
微任务
https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/queueMicrotask
https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide
https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide/In_depth
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver/MutationObserver
宏任务 / 任务
https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame
https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback
https://developer.mozilla.org/en-US/docs/Web/API/Window/setTimeout
https://developer.mozilla.org/en-US/docs/Web/API/Window/setInterval
https://developer.mozilla.org/en-US/docs/Web/API/Window/setImmediate
https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope
https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout
https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setInterval
https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setImmediate ❌
WorkerGlobalScope.importScripts()
importScripts(path0)
importScripts(path0, path1)
importScripts(path0, path1, /* … ,*/ pathN)
https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/importScripts
https://stackoverflow.com/questions/16310091/importscripts-web-workers
Web Worker
https://www.ruanyifeng.com/blog/2018/07/web-worker.html
(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!
refs
queueMicrotask & EventLoop & macrotask & microtask All In One
https://www.cnblogs.com/xgqfrms/p/13112261.html
©xgqfrms 2012-2021
www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/13387895.html
未经授权禁止转载,违者必究!