Skip to content
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: evented should cleanup dom data #7350

Merged
merged 2 commits into from
Jul 28, 2021
Merged

fix: evented should cleanup dom data #7350

merged 2 commits into from
Jul 28, 2021

Conversation

brandonocasey
Copy link
Contributor

Description

Since evented is a mixin, it should cleanup after itself. I migrated the DomData cleanup from Component to the mixin dispose event listener.

@codecov
Copy link

codecov bot commented Jul 28, 2021

Codecov Report

Merging #7350 (c9578a8) into main (3777f94) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #7350      +/-   ##
==========================================
+ Coverage   79.59%   79.62%   +0.03%     
==========================================
  Files         115      115              
  Lines        7262     7263       +1     
  Branches     1745     1745              
==========================================
+ Hits         5780     5783       +3     
+ Misses       1482     1480       -2     
Impacted Files Coverage Δ
src/js/component.js 93.67% <ø> (+0.19%) ⬆️
src/js/mixins/evented.js 98.37% <100.00%> (+0.04%) ⬆️
src/js/utils/events.js 80.90% <0.00%> (+0.50%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3777f94...c9578a8. Read the comment docs.

@@ -499,6 +500,11 @@ function evented(target, options = {}) {
// When any evented object is disposed, it removes all its listeners.
target.on('dispose', () => {
target.off();
[target, target.el_, target.eventBusEl_].forEach(function(val) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handle disposal of any DomData for the evented object.

@gkatsev gkatsev merged commit ada25c4 into main Jul 28, 2021
@gkatsev gkatsev deleted the fix/evented-dom-data branch July 28, 2021 19:55
edirub pushed a commit to edirub/video.js that referenced this pull request Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants