Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Something I whipped up.
var events = require("events");
var util = require("util");
var _ = require("lodash");
var Greeter = function() {;
console.log("I greet you");
util.inherits(Greeter, events.EventEmitter);
_.forEach(["hello", "moreHello", "mostHello"], function(n) {
Greeter.prototype[n] = function() {
var butler = new Greeter();
_.forEach(["hello", "moreHello", "mostHello"], function(n) {
butler.on(n, function () {
_.forEach([butler.hello(), butler.moreHello(), butler.mostHello()]); // FUNCTIONAL PROGRAMMING AWWWW YISS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment