Skip to content

Instantly share code, notes, and snippets.

@raimohanska
Created September 24, 2013 11:51
Show Gist options
  • Save raimohanska/6683617 to your computer and use it in GitHub Desktop.
Save raimohanska/6683617 to your computer and use it in GitHub Desktop.
RequireJS require things in given order
function requireInOrder(paths, done) {
if (paths.length == 0) {
done()
} else {
require(paths.slice(0,1), function() {
requireInOrder(paths.slice(1), done)
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment