models/PagingResult.js

export default class PagingResult {
    /**
     * Creates a PagingResult
     *
     * @constructor PagingResult
     * @param {Object[]} entries - Entries from the requested resource.
     * @param {string} nextCursor - Cursor to get next page.
     */
    constructor(entries, nextCursor) {
        this.entries = entries || [];
        this.nextCursor = nextCursor || null;
    }

    /**
     * Check if there are more entries to load.
     *
     * @memberof PagingResult
     * @return {boolean} true if there are no more entries, false otherwise.
     */
    isLastPage() {
        return this.nextCursor == null || this.nextCursor === '';
    }
}