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

Add dom.first! and dom.all! support to all selector framework plugins #18

Closed
briancavalier opened this issue Feb 3, 2012 · 1 comment
Milestone

Comments

@briancavalier
Copy link
Member

It seems like we end up writing this a lot, and the most common use case is probably fetching the first match

{ $ref: 'dom.query!.whatever', i:0 }

So let's add dom.first! that automatically resolves to the first match, rather than to a nodelist of 1 item. It can take advantage of any selector-specific optimizations, such as :first, too.

As a nice parallel, let's add dom.all! which will be a synonym for dom.query! ... and maybe we should deprecate dom.query!

@briancavalier
Copy link
Member Author

dom.all! and dom.first! now implemented in all dom plugins, even wire/dom, which will use querySelectorAll if available.

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