Source: hotspotObserverInit.js

/**
 * Inicjalizuje obserwatora na sekcjach z hotspotami. Możemy dodać threshold, aby ramki rekomendacji wczytywały się wcześniej. Jest to zrealizowane np. na sklepie pyszneeko.pl. Funkcja jest w komponencie Hotspoty JavaScript w klasie <b>GetHotspots</b>.
 * @method
 * @example
 * // Dodanie thresholdu
 * hotspotObserverInit() {
 *   this.hotspotObserver = new IntersectionObserver((entries) => {
 *     this.hotspotObserverFunc(entries);
 *   }, {
 *     rootMargin: '300px 0px'  // Threshold ustawiony na 300px
 *   });
 *   this.allHotspots.forEach((el) => this.hotspotObserver.observe(el));
 * }
 */
function hotspotObserverInit() {
	this.hotspotObserver = new IntersectionObserver(entries => {
		this.hotspotObserverFunc(entries);
	});
	this.allHotspots.forEach(el => this.hotspotObserver.observe(el));
}