src/list/load-action/builder.js
function pagination(opts) {
    let { isScroll, dataList, totalCount, nbElement } = opts;
    if (isScroll) {
        if (!isArray(dataList)) {
            throw new Error('The data list options sould exist and be an array')
        }
        if (dataList.length < totalCount) {
            return { top: nbElement, skip: dataList.length };
        }
    }
    return {
        top: nbElement,
        skip: 0
    }
}
function pagination(opts) {
    let { isScroll, dataList, totalCount, nbElement } = opts;
    if (isScroll) {
        if (!isArray(dataList)) {
            throw new Error('The data list options sould exist and be an array')
        }
        if (dataList.length < totalCount) {
            return { top: nbElement, skip: dataList.length };
        }
    }
    return {
        top: nbElement,
        skip: 0
    }
}
function pagination ( opts ) { let { isScroll , dataList , totalCount , nbElement } = opts ; if ( isScroll ) { if ( ! isArray ( dataList ) ) { throw new Error ( 'The data list options sould exist and be an array' ) } if ( dataList . length < totalCount ) { return { top : nbElement , skip : dataList . length } ; } } return { top : nbElement , skip : 0 } }
Build the pagination configuration given the options.
@param  {object} opts - The pagination options should be :
isScroll (:bool) - Are we in a scroll context.
totalCount (:number) - The total number of element. (intresting only in the scroll case)
nbSearchElement (:number) - The number of elements you want to get back from the search.
@return {object} - An object with {top, skip}.
Build the pagination configuration given the options .