EZUIKit-JavaScript-npm icon indicating copy to clipboard operation
EZUIKit-JavaScript-npm copied to clipboard

所有的addEventListener均没有做removeEventListener,典型的只会拉屎不会擦屁股

Open xiangyuecn opened this issue 5 years ago • 2 comments

https://github.com/Ezviz-OpenBiz/EZUIKit-JavaScript-npm/blob/8353e93816eef9962f530d1e88ffa338b0fee48e/ezuikit.js#L1129-L1131

每创建一次播放器就绑定一次这个事件,销毁播放器时,至少需要解除这个绑定。

现在没有解除绑定,可以明显观察到现象:创建了10次播放器,不管你关掉了几个,这个log至少会同时打印出10次。

还有另外8处addEventListener,均需处理,或者更换message的处理架构(全局绑定一次即可,轻巧,不写bug),相信你们是专业的前端。

xiangyuecn avatar Jun 07 '21 14:06 xiangyuecn

如何removeEventListener呢

conkyliu avatar Nov 16 '21 07:11 conkyliu

您好,这边不太理解您的问题

发件人: Conky_刘 @.> 发送时间: 2021年11月16日 15:07 收件人: Ezviz-OpenBiz/EZUIKit-JavaScript-npm @.> 抄送: Subscribed @.***> 主题: Re: [Ezviz-OpenBiz/EZUIKit-JavaScript-npm] 所有的addEventListener均没有做removeEventListener,典型的只会拉屎不会擦屁股 (#29)

如何removeEventListener呢

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/Ezviz-OpenBiz/EZUIKit-JavaScript-npm/issues/29#issuecomment-969937398, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AD3TVUQGSWIZGGMTNHXKQ2DUMH7K3ANCNFSM46H3BGAQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.


本邮件及其附件含有萤石公司保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件! This e-mail and its attachments contain confidential information from EZVIZ, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!

Ezviz-Open avatar Nov 16 '21 07:11 Ezviz-Open