Created
January 25, 2012 15:41
-
-
Save bennadel/1676841 to your computer and use it in GitHub Desktop.
Managed Dependencies vs. Dependency Injection In RequireJS
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
// Define our class within the dependency management system. | |
define( | |
[ | |
"dependency-1", | |
"dependency-2" | |
], | |
function( Dependency1, Dependency2 ){ | |
// Define the actual class constructor and methods. | |
function MyClass( argument1, argument2 ){ | |
// ... more code ... | |
} | |
// -------------------------------------------------- // | |
// -------------------------------------------------- // | |
// Return the class constructor to define the class | |
// representation within the dependency management system. | |
return( MyClass ); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment