* Returns the IntersectionObserver instance. If it does not exist, it will be created. * The observer will call the loadMore function when the end of the table is reached. * @private
()
| 223 | * @private |
| 224 | */ |
| 225 | _getIntersectionObserver(): IntersectionObserver { |
| 226 | if (!this._observer) { |
| 227 | this._observer = new IntersectionObserver(this._onIntersection.bind(this), { |
| 228 | root: findVerticalScrollContainer(this._table ?? document.body), |
| 229 | rootMargin: "5px", |
| 230 | }); |
| 231 | } |
| 232 | return this._observer; |
| 233 | } |
| 234 | |
| 235 | _onIntersection(entries: Array<IntersectionObserverEntry>) { |
| 236 | if (entries.some(entry => entry.isIntersecting)) { |
no test coverage detected