Last active
November 2, 2018 23:12
-
-
Save bob-lee/a14375362f97b4bbbd2e6c4363c2fc0c 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 { | |
// ... | |
private _loadAheadCount = 2; // default 2 | |
get loadAheadCount() { return this._loadAheadCount; } | |
set loadAheadCount(value: number) { | |
this._loadAheadCount = value; | |
} | |
// announce intersecting index to [lazyLoad] directives | |
private intersection$ = new Subject<any>(); | |
announcedIntersection = this.intersection$.asObservable(); | |
announceIntersection(params: object) { // { index: number, state: IntersectionState } | |
this.intersection$.next(params); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment