[dojo-contributors] live() and delegate() prototype

James Burke jburke at dojotoolkit.org
Mon Mar 8 19:42:07 EST 2010


On Mon, Mar 8, 2010 at 10:14 AM, sam foster <potatosculptor at gmail.com> wrote:
> I'm not assuming NodeList would be the only way to use closest? Why
> would it? I realize the ($ || dojo.query)( ... ).whatever() is a
> common pattern, but its not the only pattern.

IIRC, the only machinery that uses CSS selectors to select nodes to do
work start through dojo.query calls. We could implement other APIs
that do not start with a query call, the live call being probably the
first, but I want to make sure it makes sense.

There is some API simplicity to saying that API calls with CSS3
selectors starts with a dojo.query call. I expect
dojo.query(node).closest(query)  vs. dojo.closest(node, query) are not
much different speed-wise particularly with expensive queries. I
appreciate not having the extra .query() in the API call, but if the
expense is a larger base and more API surface to explain, it may not
be worth it.

James


More information about the dojo-contributors mailing list