cujojs/wire — Issue #18: Add dom.first! and dom.all! support to all selector framework plugins
Author: briancavalier
Created: 2012-02-03 15:42:43+00:00
State: open

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 can deprecate `dom.query!`