Created
January 6, 2016 08:11
-
-
Save cjohansen/ae729aef360a724b2a59 to your computer and use it in GitHub Desktop.
Some people call this "dependency injection", I call it "passing arguments"
This file contains 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 connect = require('my-connector'); | |
var dep1 = require('dep1'); | |
var dep2 = require('dep2') | |
exports.default = function (config) { | |
var connection = connect(config); | |
var myDep1 = dep1.init(connection); | |
var myDep2 = dep2.init(connection); | |
return { | |
doIt: function () { | |
// Do interesting things with myDep1 and myDep2 | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment