Skip to content

fix: disconnect IntersectionObserver when the view is destroyed#317

Closed
arturovt wants to merge 1 commit intocloudinary:masterfrom
arturovt:fix/lazy-load
Closed

fix: disconnect IntersectionObserver when the view is destroyed#317
arturovt wants to merge 1 commit intocloudinary:masterfrom
arturovt:fix/lazy-load

Conversation

@arturovt
Copy link

@arturovt arturovt commented Jul 1, 2022

  • I've moved conditions out of the class to the top level, so they're no invoked each time when the directive is created
  • I've added disconnect() call on the observer when the directive is destroyed, since unobserve() just stops observing the element, but doesn't stop observing the entire viewport

This pull request was closed.
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.

1 participant