danyill / oscd-subscriber-later-binding

IEC 61850 Ed 2 subscription for GOOSE and SV in OpenSCD
Apache License 2.0
3 stars 4 forks source link

Event Handlers duplicated? #54

Open danyill opened 5 months ago

danyill commented 5 months ago

I suspect the event handlers in this plugin are being recreated constantly due to the anonymous functions used to do this:

https://github.com/danyill/oscd-subscriber-later-binding/blob/68c5dd8ec5f65a1d040d739bffc57389cf9e1700/oscd-subscriber-later-binding.ts#L1186-L1289

See the note and preceding text in the addEventListener MDN docs: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#sect3