Last active
August 29, 2015 14:24
-
-
Save tjunghans/11ec0959c69dee9636d4 to your computer and use it in GitHub Desktop.
Inherit from NodeJS Eventemitter
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
// EventEmitter pattern: https://www.joyent.com/developers/node/design#EventEmitter | |
var EventEmitter = require('events').EventEmitter; | |
var utils = require('utils'); | |
function Controller() { | |
if (!(this instanceof Controller)) return new Controller(); | |
EventEmitter.call(this); | |
} | |
utils.inherits(Controller, EventEmitter); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment