function doneQuery(response) {
      var isLastQuery = (response.notifications.length < request.limit);
      
      // Send out request for the next page of data, if it exists.
      if (!isLastQuery) {
        request.start_key = response.last_key;
        sendQuery();
      } 
      
      // Invoke the visitor on each notification received.
      _(response.notifications).each(visitor);
      
      // If this was the last page of the query, resolve this method's promise.
      if (isLastQuery) deferred.resolve();
    }
// which will query the next page and returns it.
which will query the next page and returns it.
which will query the next page and returns it .
function doneQuery(response) {
      var isLastQuery = (response.notifications.length < request.limit);
      if (!isLastQuery) {
        request.start_key = response.last_key;
        sendQuery();
      } 
      _(response.notifications).each(visitor);
      if (isLastQuery) deferred.resolve();
    }
function doneQuery ( response ) { var isLastQuery = ( response . notifications . length < request . limit ) ; if ( ! isLastQuery ) { request . start_key = response . last_key ; sendQuery ( ) ; } _ ( response . notifications ) . each ( visitor ) ; if ( isLastQuery ) deferred . resolve ( ) ; }
which will query the next page and returns it.
which will query the next page and returns it .
// Send out request for the next page of data, if it exists. // Invoke the visitor on each notification received. // If this was the last page of the query, resolve this method's promise.