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

Optimize performance for single-element selectors #7

Open
jdorn opened this issue Feb 18, 2021 · 0 comments
Open

Optimize performance for single-element selectors #7

jdorn opened this issue Feb 18, 2021 · 0 comments

Comments

@jdorn
Copy link
Member

jdorn commented Feb 18, 2021

If you call mutate("#myid", ...), once a matching element is found, we can stop waiting for new elements to appear, since ids are unique on a page.

  • [^,]*#id - id match (with optional narrowing prefix)
  • body or html - specific elements that can only exist once on a page

We can also add an optional 4th argument to mutate with config options, one of which explicitly says to only match the first element found.

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

No branches or pull requests

1 participant