hey icon indicating copy to clipboard operation
hey copied to clipboard

Contribute

Open cobrowserAlex opened this issue 10 years ago • 1 comments

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();
          }
        }
      }
    }

cobrowserAlex avatar Jan 12 '15 11:01 cobrowserAlex

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.

  1. What kind of error is Grunt reporting when you try and run karma/dist?
  2. What version of Grunt are you running?
  3. What version of node are you running?

callmehiphop avatar Jan 12 '15 16:01 callmehiphop