npm-dom / dom-event

Add/remove DOM events
http://npm.im/dom-event
34 stars 7 forks source link

Pass in a node list and not just one HTMLElement #4

Open mikkoh opened 9 years ago

mikkoh commented 9 years ago

Sometimes you want to add lets say a click event to an entire NodeList.

require( 'dom-select' ).all( 'something' )

Returns a NodeList.

azer commented 9 years ago

@MikkoH can we make this a separate module to keep this module plain & simple ? I can add u to the organization for letting u create repos

mikkoh commented 9 years ago

Sure sounds good. Do you for see this being a breaking feature for dependents? Or is there some other reason why you wouldn't want to implement passing in a NodeList?

mikkoh commented 9 years ago

I understand it can be a slippery slope where then next you want to implement if someone passes an Array etc etc. And then you end up with jQuery. But I see selecting NodeList and HTMLElement to be super similar. Hmmm...