code: function delegate (root, filter, fn) {
    if (delegates[fn._dd]) {
      return delegates[fn._dd];
    }
    fn._dd = Date.now();
    delegates[fn._dd] = delegator;
    function delegator (e) {
      var el = e.target;
      while (el && el !== root) {
        if (api.matches(el, filter)) {
          fn.apply(this, arguments); return;
        }
        el = el.parentElement;
      }
    }
    return delegator;
  }
docs: this method caches delegates so that .off() works seamlessly