简体   繁体   English

是否可以在JavaScript中访问事件队列?

[英]Is it possible to access the event queue in JavaScript?

I've some articles on how the event loop works. 我有一些关于事件循环如何工作的文章。 My question is whether there's some way I can access the current queue of functions that are scheduled to be executed. 我的问题是我是否可以通过某种方式访问​​计划执行的当前函数队列。 Just for fun. 纯娱乐。

Not normally, it's all behind the scenes. 不正常,一切都在幕后。

The only way you could do it would be to overload the functions like addEventListener and dispatch so you can add in some of your own logic and then watch them, but that would be a lot of work "just for fun". 你可以做的唯一方法是重载addEventListenerdispatch类的函数,这样你就可以添加一些你自己的逻辑然后观察它们,但这将是很多工作“只是为了好玩”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM