Assume I have the following initializers:
App.initializer name: "first" initialize: (container) -> $.get('/api/connect').then (data) # do some work App.initializer name: "second" after: "first" initialize: (container) -> # do something that requires result of first initializer
As it currently stands the initializers will run in the correct order, but the second initializer will (potentially) run before the ajax callback has completed. If you have an asynchronous initializer that should block boot you can use
deferReadiness, but for the above case that won’t work, you need to combine the two initializers into one (I believe).
My proposal is that initializers should respect promises, and only execute the next initializer if initialize returns null and/or a resolved promise.