Using the intersection has the issue that the it only triggers when the element enters view, not while in view.
This means sometimes to trigger the loadMore you have to scroll away and then back again.
This is especially true when the contents that load in don't push the smoothly-load-more component enough to move out of view.
Scroll
This PR is adding the ability to listen to scroll instead of Intersection.
This will trigger a smoothlyLoadMore event on scroll if the element is in view.
The problems with scroll is that it will trigger a lot of events, so it's not recommended to use if you don't have some debouncing for when listening to the event.
Alternative triggerMode names
The triggerMode could be called something triggerOn with valus like
"enterScreen" | "onScreen"
or
"enterView" | "inView"
Since this is basically the difference between them.
The flaw of using intersection
Using the intersection has the issue that the it only triggers when the element enters view, not while in view.
This means sometimes to trigger the loadMore you have to scroll away and then back again. This is especially true when the contents that load in don't push the
smoothly-load-more
component enough to move out of view.Scroll
This PR is adding the ability to listen to scroll instead of Intersection. This will trigger a smoothlyLoadMore event on scroll if the element is in view.
The problems with scroll is that it will trigger a lot of events, so it's not recommended to use if you don't have some debouncing for when listening to the event.
Alternative triggerMode names
The
triggerMode
could be called somethingtriggerOn
with valus like"enterScreen" | "onScreen"
or"enterView" | "inView"
Since this is basically the difference between them.