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
在使用observejs时为了跟原生的Object.observe 兼容,我写了如下代码
objectObserve = Object.observe || function (obj, fun){ observe(obj, function (name, value, oldValue) { fun && fun([{ type: 'update', name: name, oldValue: oldValue }]); }) };
结果发现fun回调会被执行多次,目前我的办法是加一个定时器,100ms内只允许执行一次,这样可以解决多次触发的问题,但不太理解为什么会有触发多次的问题?
The text was updated successfully, but these errors were encountered:
observe(obj,xx)执行过多少次就会触发多少次。你重复绑定了多次? @gafish
Sorry, something went wrong.
最终我们用了 https://github.com/MaxArt2501/object-observe 这个方案,不用改业务代码,引入库文件即可,改动最小
那个库好像是用定时器 @gafish
No branches or pull requests
在使用observejs时为了跟原生的Object.observe 兼容,我写了如下代码
结果发现fun回调会被执行多次,目前我的办法是加一个定时器,100ms内只允许执行一次,这样可以解决多次触发的问题,但不太理解为什么会有触发多次的问题?
The text was updated successfully, but these errors were encountered: