Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. export class ApplicationInitStatus {
  2. constructor(@Inject(APP_INITIALIZER)private appInits) { }
  3.  
  4. runInitializers() {
  5. const asyncInitPromises = [];
  6.  
  7. if (this.appInits) {
  8. for (let i = 0; i < this.appInits.length; i++) {
  9. const initResult = this.appInits[i]();
  10. if (isPromise(initResult)) {
  11. asyncInitPromises.push(initResult);
  12. }
  13. }
  14. }
  15.  
  16. Promise.all(asyncInitPromises).then(() => { complete(); })
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement