Created
November 2, 2018 11:31
-
-
Save bob-lee/83233b2be7bcf7d433a66c4f8124ad78 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
export class LazyLoadService { | |
delayMsec = 0; | |
// announce order to [lazyLoad] directives | |
private order$ = new Subject<string>(); | |
announcedOrder = this.order$.asObservable(); | |
announceOrder(name: string) { | |
this.order$.next(name); | |
} | |
registerAfter(msec: number) { | |
if (msec > 0) { | |
this.delayMsec = msec; | |
setTimeout(_ => this.announceOrder('register'), msec); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment