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

Different viewport options with same root #147

Closed
Silvest89 opened this issue Feb 20, 2019 · 3 comments
Closed

Different viewport options with same root #147

Silvest89 opened this issue Feb 20, 2019 · 3 comments

Comments

@Silvest89
Copy link

As I was browsing the code (have tested it as well)
Whenever you use the same root element though with different viewport options (different elements are being checked) only the already existing options get fetched.

What you do is check if the root element exist if yes get that instance.

   const foundedEntry = this.findEntry(config.root);
      if (foundedEntry && !foundedEntry.targets.has(target)) {
        foundedEntry.targets.add(target);
        foundedEntry.observer.observe(target);
      } else {
@k3nsei
Copy link
Owner

k3nsei commented Feb 20, 2019

Yes it's simple optimization that was introduced in the past. But it need to be extend to support more advanced cases. It's on my todo list, but I haven't had time to do this yet.

@k3nsei
Copy link
Owner

k3nsei commented Apr 12, 2020

Code is ready need to release it

@k3nsei
Copy link
Owner

k3nsei commented Apr 13, 2020

Feature is present in release v6.1.0

@k3nsei k3nsei closed this as completed Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants