-
Notifications
You must be signed in to change notification settings - Fork 188
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
Could observe one element only once #119
Comments
Do you have an example of how that could be achieved? You'd have to give the same |
Yep. In my case I have 2 "levels" of Observers, let call it "block level" and "element level", to produce something like "waterfall" animation - "internal" observer should not fire until "parent" block will "enough" visible. |
This seems like an edge case, that is related to the DOM structure of your component. I'm guessing you could solve it by ensuring you don't use the same element for both observers? It would require a complete rewrite of the Intersection handler in |
If you could not support it yet - what about printing some debug information when someone starts observing already observed node? |
That's fair. I'll add an |
I just published a version that throws an error if you try to observe the same element twice. Give it a try! |
Simple problem - as long you are tracking
elements
viaINSTANCE_MAP.set(element, instance)
- one element could be associated with one one instance.If, but any reason, 2 different observers observe one element - only one would work - the top one.
The text was updated successfully, but these errors were encountered: