-
-
Notifications
You must be signed in to change notification settings - Fork 867
Fix: unable to remove listener with layer(s) registered with Map#once #4592
New issue
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
Fix: unable to remove listener with layer(s) registered with Map#once #4592
Conversation
for (const key in delegatedListener.delegates) { | ||
const delegate: Delegate = delegatedListener.delegates[key]; | ||
delegatedListener.delegates[key] = (...args: Parameters<Delegate>) => { | ||
this._removeDelegatedListener(type, layerIds, listener); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My concern is that in this._removeDelegatedListener
the Map#off
is called. On the other hand here we have reference to delegate
, so it shouldn't harm. As a solution for that, we can add parameter, to skip calling off
in this._removeDelegatedListener
.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4592 +/- ##
==========================================
- Coverage 87.88% 87.87% -0.02%
==========================================
Files 247 247
Lines 33601 33613 +12
Branches 2336 2339 +3
==========================================
+ Hits 29530 29536 +6
+ Misses 3108 3105 -3
- Partials 963 972 +9 ☔ View full report in Codecov by Sentry. |
…o fix-unable-to-remove-once-listener-with-layers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!!
This PR fixes issue, that Map#off does not deregister an event registered with Map#once, when layer(s) are provided.
Launch Checklist
CHANGELOG.md
under the## main
section.