aurajs/aura — pull request #257 by mbektimirov (2013-06-04 11:16:45+00:00)
Title: Implemented #172 with promises

App.start now returns a promise which depends on all application widgets promisses. Just return a promise() in widget 'initialize' method to handle async loading. Sample code is bellow.

```javascript
// test widget
define(function() {
return {
initialize: function() {
var dfd = this.sandbox.data.deferred();

this.html('I am a test');

setTimeout(function () {
dfd.resolve();
}, 3000);

return dfd.promise();
}
};
});

// main app
require(['lib/aura'], function(Aura) {
Aura({ debug: { enable: true } }).start({ widgets: 'body' }).then(function() {
// this callback will be called after test widget
// deferred object will resolved (after 3000 ms)
console.warn("Aura app started !");
});
});
```