Skip to content

Instantly share code, notes, and snippets.

@bryanforbes
Created May 18, 2011 22:16
Show Gist options
  • Select an option

  • Save bryanforbes/979712 to your computer and use it in GitHub Desktop.

Select an option

Save bryanforbes/979712 to your computer and use it in GitHub Desktop.
async def
define.async(["dep1", "dep2"], function(loaded, dep1, dep2){
someAsyncOperation(function(){
loaded({
/* module definition here */
});
});
});
define.async(["./gfx/_base"], function(loaded, _base){
var gfx = {};
/* figure out renderer */
require(["./gfx/" + renderer], function(renderer){
loaded(gfx);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment