Ashwin Sureshkumar
Jul 10, 2017 · 1 min read

Hi Fanis Despoudis,

Thanks for the feedback and suggestions. This blog post was not about exhaustive/optimized implementation of a library but concepts which involves in implementing an infinite scroll.

For infinite scroll implementation these are the requirements which I wanted to cover,

  1. Events when scrolled down which needs to keep track of previously scrolled position
  2. Trigger the event only when passed certain percentage of the container
  3. Wait until the previous http/async call is done and only then emit the event of scroll (This would avoid the consumer implementing this conditional)
  4. Debounce the events so scroll events are not emitted on each single scroll.

These are the above concepts that I wanted to showcase.

The reference of ion-infinite-scroll, this is the source code and it is a different implementation : https://github.com/ionic-team/ionic/blob/master/src/components/infinite-scroll/infinite-scroll.ts.

ion-infinite-scroll is not a simple approach as well, the comparison you had made was about the directive API exposed vs Library implementation if I am correct.

Regarding, the line you mentioned

.subscribe(() => {})

was to showcase you can perform post processing if required, I could have just done the below.

.subscribe()

I will make that change to the post as it wasn’t conveying the intended thought.

Again, thank you so much for taking time to read and post feed, really appreciate it.

    Ashwin Sureshkumar

    Written by

    Engineering Manager @Walmart Labs

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade