bos-web-engine icon indicating copy to clipboard operation
bos-web-engine copied to clipboard

🔷 [Epic] Support Intersection Observer API

Open mpeterdev opened this issue 2 years ago • 1 comments

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

mpeterdev avatar Nov 01 '23 14:11 mpeterdev

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

mpeterdev avatar Nov 01 '23 14:11 mpeterdev