sdk/src/sync/pull.js
function pullAllPages() {
        // 1. Pull one page
        // 2. Check if Pull is complete
        // 3. If it is complete, go to 5. If not, update the query to fetch the next page.
        // 4. Go to 1
        // 5. DONE
        return pullPage().then(function(pulledRecords) {
            if (!isPullComplete(pulledRecords)) {
                // update query and continue pulling the remaining pages
                return updateQueryForNextPage(pulledRecords).then(function() {
                    return pullAllPages();
                });
            }
        });
    }
function pullAllPages() {
        // 1. Pull one page
        // 2. Check if Pull is complete
        // 3. If it is complete, go to 5. If not, update the query to fetch the next page.
        // 4. Go to 1
        // 5. DONE
        return pullPage().then(function(pulledRecords) {
            if (!isPullComplete(pulledRecords)) {
                // update query and continue pulling the remaining pages
                return updateQueryForNextPage(pulledRecords).then(function() {
                    return pullAllPages();
                });
            }
        });
    }
function pullAllPages ( ) { // 1. Pull one page // 2. Check if Pull is complete // 3. If it is complete, go to 5. If not, update the query to fetch the next page. // 4. Go to 1 // 5. DONE return pullPage ( ) . then ( function ( pulledRecords ) { if ( ! isPullComplete ( pulledRecords ) ) { // update query and continue pulling the remaining pages return updateQueryForNextPage ( pulledRecords ) . then ( function ( ) { return pullAllPages ( ) ; } ) ; } } ) ; }
Pulls all pages from the server table, one page at a time.
Pulls all pages from the server table one page at a time .