Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds docs for steal.done, fixes #489
- Loading branch information
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@property {function} steal.done | ||
@parent StealJS.functions | ||
|
||
A promise for when the application has loaded. Useful if you want to automatically run some code (like tests) after everything has loaded. | ||
|
||
@signature `steal.done()` | ||
|
||
@return {Promise} A promise that will resolve when the [System.configMain] and [System.main] have loaded. | ||
|
||
@body | ||
|
||
## Use | ||
|
||
Calling **steal.done** is useful in scenarios where you need to start some process after the dependency graph of your application has been fully imported. For example (used with [@steal]): | ||
|
||
var steal = require("@steal"); | ||
var QUnit = require("qunit"); | ||
|
||
steal.done().then(function(){ | ||
QUnit.load(); | ||
}); | ||
|
||
This will start running QUnit tests after all modules have loaded. |