Why does the IntersectionObserver Callback only take care of the first entry?
I was caught on an issue: When the page was mounted, not every time the @infinite event was called.
After I added console.log to the IntersectionObserver callback, I found that the entries param was an array with 2 items.
But the code shows that only first item of entries is used. Why ?
https://github.com/oumoussa98/vue3-infinite-loading/blob/089119fcfe75d18d406737707fcddd5adc49326a/src/utils.ts#L34
Shouldn't this code be like:
const entry = entries.at(-1);
The observer is intended to observe only one element, which is the infinite-loading component itself; so entries length shouldn't be more than 1 element; https://github.com/oumoussa98/vue3-infinite-loading/blob/089119fcfe75d18d406737707fcddd5adc49326a/src/utils.ts#L42
however, it could also be caused by this issue #78 that has been fixed in the latest version;
I recommend upgrading to the latest version (1.3.2); If the problem persists, please provide a repro so we can further investigate;