Catalysing your Angular 4 app Performance
Param Singh

Thanks for the article. For scrolling I came with next some time ago: => {
Observable.fromEvent(this.scrollSource, 'scroll')
// .throttleTime(300)
// .merge(obs.debounceTime(300)) // need to merge debounced event or we loose some events on fast scroll
.sampleTime(300) // gives best result and no need to merge several streams
.subscribe((e: UIEvent) => { => {

sampleTime working better for me (similar directive). Maybe not an issue for 20ms delay, but I wanted to use longer delay to reduce possible overhead (and count of events emitted by directive) to minimum.

Like what you read? Give Vladimir Tolstikov a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.