Created
July 3, 2015 09:39
-
-
Save KeKs0r/1473d2a118dd51732bf8 to your computer and use it in GitHub Desktop.
More Verbose Flux Dispatcher for Marty
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Marty = require('marty'); | |
export default class Application extends Marty.Application { | |
constructor(options) { | |
super(options); | |
} | |
// Custom Dispatcher verbose Dispatcher | |
var vomitify = function(f) { | |
return function() { | |
try { | |
// Does weirdStuff in binCallback | |
return f.apply(this, arguments); | |
} catch(e) { | |
console.error(e); | |
} | |
}; | |
}; | |
var dispatcher = this.dispatcher; | |
var proto = Object.getPrototypeOf(dispatcher); | |
dispatcher.register = function(f) { | |
proto.register.call(this, vomitify(f)); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment