Paginating a Backbone collection
You could do something like this

paginateTo: (id) -&gt;
  deferred   = new $.Deferred
  modelCheck = null

  modelExists = =&gt;
    modelCheck or= @checkModelExists id

  fetchUntilFound = =&gt;
    return deferred.resolve model if model = @get id
    modelExists().fail deferred.reject
    modelExists().done =&gt;
      @fetchNextPage().then fetchUntilFound, deferred.reject

  fetchUntilFound()
  deferred.promise()