Skip to content

Instantly share code, notes, and snippets.

@tkh44
Last active December 21, 2015 17:58
Show Gist options
  • Save tkh44/6343624 to your computer and use it in GitHub Desktop.
Save tkh44/6343624 to your computer and use it in GitHub Desktop.
parse: function (events, options) {
var eventKeys = _.keys(events || {}),
limitEvents,
parsedEvents = [];
// Optionally filter using set of acceptable event types
limitEvents = options.only;
eventKeys = _.filter(eventKeys, function checkEventName (eventKey) {
// Parse event string into semantic representation
var event = Framework.Util.parseDOMEvent(eventKey);
// Optional filter
if (limitEvents && !_.contains(limitEvents, event.name)) {
return false;
}
parsedEvents.push(event);
return true;
});
return parsedEvents;
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment