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

fixes #216, remove unnecessary call to startIntersectionObserver #217

Merged

Conversation

dbashford
Copy link
Contributor

Closes #216

Changes proposed in this pull request

The in-viewport service has a startIntersectionObserver function which creates an instance of observerAdmin. The in-viewport mixin has a call to startIntersectionObserver that does not check to see if observerAdmin already exists. This resulted in the single instance of observerAdmin inside the service being replaced every time a component using the mixin was created. observerAdmin has WeakMap "registry"s of element references that are useful to have access to when debugging issues using this addon, and the instance changing made that impossible to leverage.

The mixin's call to startIntersectionObserver proves to be unnecessary as it is immediately called inside watchElement. That call IS protected so that observerAdmin is only ever created once.

This PR removes the mixin's call to startIntersectionObserver.

Thanks, all!

@snewcomer snewcomer added the bug label Dec 19, 2019
Copy link
Collaborator

@snewcomer snewcomer left a comment

Choose a reason for hiding this comment

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

This is great! Thank you 💯 for taking the time to dig through!

@snewcomer snewcomer merged commit f2d0512 into DockYard:master Dec 19, 2019
@snewcomer snewcomer mentioned this pull request Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Debugging potential leaks
2 participants