import { athenaConfigOptions } from '../../../global/athena-config.js';
import { fetchMoreDataNext } from '../../ajax/infinite-scroll/fetch-more-data-next.js';

/**
 * Scroll Page Function
 * Call function for Load more products
 *
 * @param entries
 */
function scrollPage(entries) {
    const entry = entries[0];

    if(entry.isIntersecting) {
        if (athenaConfigOptions.scrollStatus && athenaConfigOptions.nextPage) {
            athenaConfigOptions.scrollStatus = false;
            fetchMoreDataNext();
        }
    }
}


//Exporting all Functions
export {
    scrollPage
}