Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
var extend = require('xtend');
module.exports = SinkEventHandler;
function SinkEventHandler(sink, data) {
if (!(this instanceof SinkEventHandler)) {
return new SinkEventHandler(sink, data);
this.sink = sink; =; = extend({ preventDefault: true }, data);
SinkEventHandler.prototype.handleEvent = handleEvent;
function handleEvent(ev) {
var data =;
if (data.preventDefault) ev.preventDefault();
if (typeof this.sink === 'function') {
} else {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.