Implement infinity scroll on javascript

i want to implement infinity scroll on my component, but every time i scroll and call fetchprevious, the message that sent always same

Could you please elaborate.