2016-05-19 23:25:17 +00:00
|
|
|
# early
|
2016-05-21 22:38:14 +00:00
|
|
|
minimal and fast loading animation for modules that need a little starting time.
|
2016-05-19 23:25:17 +00:00
|
|
|
|
2016-05-21 22:38:14 +00:00
|
|
|
## Usage
|
2016-05-19 23:25:17 +00:00
|
|
|
|
2016-05-21 22:38:14 +00:00
|
|
|
```typescript
|
|
|
|
// Put the following at the start of your module
|
2016-05-19 23:25:17 +00:00
|
|
|
import * as early from "early";
|
2016-05-21 22:38:14 +00:00
|
|
|
early.start("myModuleName");
|
|
|
|
/*
|
|
|
|
do your loading stuff
|
|
|
|
*/
|
2016-09-15 12:59:22 +00:00
|
|
|
early.stop().then((loadingTime:number) => { // loadingTime in milliseconds
|
|
|
|
|
|
|
|
}); // stop "early" when your module is ready
|
2016-05-19 23:25:17 +00:00
|
|
|
```
|
|
|
|
|
2016-05-23 03:17:02 +00:00
|
|
|
early runs in its own process: The loader animation runs smoothly even when your event queue of your currently loading module is working heavily.
|