如何将一个函数加入微队列
asyncFunction(fun): void {
if (typeof Promise !== 'undefined') {
void Promise.resolve().then(fun)
} else if (typeof MutationObserver !== 'undefined') {
const textNode = document.createTextNode('0')
const ob = new MutationObserver(fun)
ob.observe(textNode, { characterData: true })
textNode.data = '1'
} else {
setTimeout(fun)
}
}