1.0.0 • Published 9 years ago
once-events v1.0.0
once-events
Wait for multiple DOM events
Install
$ npm install --save once-events
Usage
var onceEvents = require('once-events')
onceEvents([element1, element2], 'click', function (events) {
//=> element1 click event is events[0]
//=> element2 click event is events[1]
})
API
onceEvents(targets, event, callback)
-> undefined
targets
Required
Type: array[eventTarget]
An array of DOM EventTargets.
event
Required
Type: string
The event to listen on.
callback
Required
Type: function
Arguments: events
A callback called with an array of events. The order matches the order of the targets, not the order in which the events ocurred.
License
MIT © Ben Drucker
1.0.0
9 years ago