Loader
Helper class for waiting for async code to complete, before continuing with code. Allows multiple async loading of different types (prmoises/async-await functions) to be organized into one "Loader".
Constructor Summary
Public Constructor | ||
public |
constructor(loadCompleteCallback: function) Loader constructor. |
Member Summary
Public Members | ||
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
Method Summary
Public Methods | ||
public |
Adds a Promise to the loader. |
|
public |
start() Notifies the loader that you allow the loadCompleteCallback to be triggered once all items are loaded. |
Public Constructors
Public Members
public loadCompleteCallback: * source
Public Methods
public load(promise: Promise) source
Adds a Promise to the loader. Adding a promise wraps it allow the Loader to determine when loading is done. The load complete callback is not triggered until start() is called.
Params:
Name | Type | Attribute | Description |
promise | Promise | A pending promise. |
public start() source
Notifies the loader that you allow the loadCompleteCallback to be triggered once all items are loaded. Items will be loading before start is called, the results are just queued until start is called.