Created
September 27, 2013 08:55
-
-
Save fantactuka/6725878 to your computer and use it in GitHub Desktop.
Loading modules in a specific order
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
| var requireQueue = function(modules, callback) { | |
| function load(queue, results) { | |
| if (queue.length) { | |
| require([queue.shift()], function(result) { | |
| results.push(result); | |
| load(queue, results); | |
| }); | |
| } else { | |
| callback.apply(null, results); | |
| } | |
| } | |
| load(modules, []); | |
| }; | |
| requireQueue([ | |
| 'app/app', | |
| 'app/apps/home/initialize', | |
| 'app/apps/main/main-app', | |
| 'app/apps/entities/initialize', | |
| 'app/apps/external-contact-entities/initialize', | |
| 'app/apps/cti/initialize', | |
| 'app/apps/fileupload/initialize' | |
| ], function(App) { | |
| App.start(); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment