defer
"Let go of the thoughts that don't make you strong." —Unknown
本文为 《lodash 源码阅读》 系列文章,后续内容会在 github 中发布,欢迎 star,gitbook 同步更新。
源码
原理
通过 setTimeout
将 func
插入到 JavaScript 事件循环的消息队列中,使 func
会在当前堆栈清理完毕后被调用。
相关链接
Last updated
Was this helpful?