Created
May 13, 2011 22:27
-
-
Save bgerrissen/971430 to your computer and use it in GitHub Desktop.
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
// you know | |
require(); | |
define(); | |
// next step | |
compose( "scopeID" , [ "extra" ], function( src , extra ){ | |
// all options | |
src( "some/module" ) // a js class or object | |
.id( "myModule" ) // make it referencable | |
.args( 1 , 2 ) // constructor args | |
.when.domFind( ".cssExpression" ) // load and create it when this condition is met | |
.when.domEvent( "click" , ".cssExpression" ) // ditto | |
.when.browserUrl( "/path/page" ) // ditto | |
.set( "propName" , "some/other/moduke" ) // dependency injection | |
.invoke( "methodName" , "arg1" , "arg2" ) | |
; | |
src( "other/module" ) | |
.set( "prop" , "@myModule" ) // module instance we stored earlier (if conditions where met) | |
.when( true ) // load and create now | |
; | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment