We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
facebook/react#14226
在16.8中的scheduler中用到window.postmessage,这样会存在两个问题:
现在最新的scheduler直接使用new MessageChannel来解决第一个问题,建立一个通信信道,利用port.postmessage代替window.postmessage,利用port.onmessage代替window.addEventListener('message', ...)。这个port实际就是这个MessageChannel专属的,不会导致信号串扰。
The text was updated successfully, but these errors were encountered:
facebook/react#16271
scheduler 中 requestAnimation 构成的循环对CPU的利用率低于 message 构成的循环
但是测试代码在哪?
Sorry, something went wrong.
No branches or pull requests
facebook/react#14226
在16.8中的scheduler中用到window.postmessage,这样会存在两个问题:
为了避免第二个问题,scheduler中的message处理函数会判断接收的数据中是否有messageKey,如果没有那么是不会继续执行下去的。
但是第一个问题避免不了,每次postmessage都会执行与react-scheduler不相关的message事件处理函数。
现在最新的scheduler直接使用new MessageChannel来解决第一个问题,建立一个通信信道,利用port.postmessage代替window.postmessage,利用port.onmessage代替window.addEventListener('message', ...)。这个port实际就是这个MessageChannel专属的,不会导致信号串扰。
The text was updated successfully, but these errors were encountered: