bos-web-engine
bos-web-engine copied to clipboard
🔷 [Epic] Support Intersection Observer API
Description
The Intersection Observer API is a modern API for handling use cases like lazy-loading and infinite scrolling
Resources
https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API
I have a feeling this will not be feasible to implement in a way that matches the native API. It is more likely that we will need to determine the use cases and build a custom integration
We could specify a flag for the <Widget /> component which, when set, rigs up an intersection observer for the root element produced by that component to call a specific function in that component
<Widget src='near/widget/Feed.Footer' observeVisible={true} />
// Feed/Footer.jsx
export onVisible = () => {
// load more content
};
.... etc