index.js
function handle(top, element, type, fn, capture) {
  if (!element || !(typeof element === 'string' || typeof element.length === 'number' || typeof element.addEventListener === 'function')) {
    throw new TypeError('Cannot bind event ' + inspect(type) + ' to ' + inspect(element));
  }
  if (typeof type !== 'string') throw new TypeError('Event type must be a string, e.g. "click", not ' + inspect(type));
  if (typeof fn !== 'function') throw new TypeError('`fn` (the function to call when the event is triggered) must be a function, not ' + inspect(fn));
  if (capture !== undefined && capture !== false && capture !== true) {
    throw new TypeError('`capture` must be `undefined` (defaults to `false`), `false` or `true`, not ' + inspect(capture));
  }

  if (typeof element === 'string') {
    return handleElement(top, type, function (body, e) {
      var target = findMatch(body, e.target, element);
      e.delegateTarget = target;
      if (target) fn(target, e);
    }, capture);
  } else if (typeof element.addEventListener !== 'function' && typeof element.length === 'number') {
    return handleElements(element, type, fn, capture);
  } else {
    return handleElement(element, type, fn, capture);
  }
}
function handle(top, element, type, fn, capture) {
  if (!element || !(typeof element === 'string' || typeof element.length === 'number' || typeof element.addEventListener === 'function')) {
    throw new TypeError('Cannot bind event ' + inspect(type) + ' to ' + inspect(element));
  }
  if (typeof type !== 'string') throw new TypeError('Event type must be a string, e.g. "click", not ' + inspect(type));
  if (typeof fn !== 'function') throw new TypeError('`fn` (the function to call when the event is triggered) must be a function, not ' + inspect(fn));
  if (capture !== undefined && capture !== false && capture !== true) {
    throw new TypeError('`capture` must be `undefined` (defaults to `false`), `false` or `true`, not ' + inspect(capture));
  }

  if (typeof element === 'string') {
    return handleElement(top, type, function (body, e) {
      var target = findMatch(body, e.target, element);
      e.delegateTarget = target;
      if (target) fn(target, e);
    }, capture);
  } else if (typeof element.addEventListener !== 'function' && typeof element.length === 'number') {
    return handleElements(element, type, fn, capture);
  } else {
    return handleElement(element, type, fn, capture);
  }
}
Bind `element` event `type` to `fn`.

@param {Element} top The element to begin delegating from
@param {Element|Array|String} element An element, list of elements or a selector string
@param {String} type
@param {Function} fn
@param {Boolean} capture
@return {Function}
@api public