code: function dispatch(eventNames) {
      var args = [];
      for (let i = 0; i < arguments.length; i++){
        args.push(arguments[i]);
      }
      args.shift();
  
      let events = getEventNames(eventNames);
  
      return events.reduce((promise, eventName) => {
        return promise.then((result) => {
          var firstHandler = _.find(buckets, function(item){
            return item.pattern.test(eventName);
          });
          if (!firstHandler) {
            return Promise.resolve(result);
          }
          return Promise.try(function(){
            return firstHandler.handler.apply(null, [eventName].concat(args));
          }).then(function(){
            if (firstHandler.once) {
              _.remove(buckets, (item) => {
                return item === firstHandler;
              });
              firstHandler.once.resolve();
            }
            return true;
          });
        });
      }, Promise.resolve(false));
    }
docs: Dispatch events by calling handlers in series. If a handler throws an exception
  (or an async handler returns a promise that is rejected), no other handlers will
  be executed. All arguments sent to this method are passed to each handler
  
  @public
  @method
  @param {Array|String} eventNames - name(s) of the event to dispatch (required)
  @returns {Promise} a promise that resolves when all handlers finish, or is rejected when the any handler is rejected