Created
October 27, 2011 14:11
-
-
Save timmywil/1319648 to your computer and use it in GitHub Desktop.
Modules with deferred dependencies
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
// This could be compatible with jQuery's Deferred implementation, | |
// futures.js (slightly different syntax) or any one of a number | |
// of other implementations | |
define(['lib/Deferred'], function( Deferred ){ | |
var defer = new Deferred(); | |
require(['lib/templates/?index.html','lib/data/?stats'], | |
function( template, data ){ | |
defer.resolve({ template: template, data:data }); | |
} | |
); | |
return defer.promise(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment