hey
hey copied to clipboard
Contribute
Hey (pun intended)
I wanted to contribute, but the karma task doesn't seem to run. I couldn't run the dist task. What i wanted to add is being able to handle 'stop'ping handlers for an event that doesn't exist.
/**
* Removes listeners from the scope regardless of the scope to which they were added.
*
* If a callback is provided it will only remove that single callback, otherwise all
* listeners listening to the given event will be removed.
*
* @param {string} eventName Name of the even which listeners should be removed
* @param {function} [callback] Optionally a single callback which should be removed
*/
function stop(eventName, callback) {
var group = listeners[eventName];
var i = group ? group.length - 1 : false;
function shouldBeDeleted(listener) {
return callback ? listener.cb === callback : true;
}
if(group) {
for (; i > -1; i--) {
if (shouldBeDeleted(group[i])) {
group.splice(i, 1)[0].destroy();
}
}
}
}
hey @cobrowserAlex
Thanks for wanting to contribute! I'm not 100% sure I understand your request, but maybe we could get your grunt tasks working and you could submit a pr from there.
- What kind of error is Grunt reporting when you try and run karma/dist?
- What version of Grunt are you running?
- What version of node are you running?