torso-bundle.js
function(options) {
            options = options || {};

            //find ids that we don't have in cache and aren't already in the process of being fetched.
            var idsNotInCache = _.difference(this.getTrackedIds(), _.pluck(parentInstance.models, 'id'));
            var idsWithPromises = _.pick(parentInstance.idPromises, idsNotInCache);

            // Determine which ids are already being fetched and the associated promises for those ids.
            options.idsToFetch = _.difference(idsNotInCache, _.uniq(_.flatten(_.keys(idsWithPromises))));
            var thisFetchPromise = this.fetch(options);

            // Return a promise that resolves when all ids are fetched (including pending ids).
            var allPromisesToWaitFor = _.flatten(_.values(idsWithPromises));
            allPromisesToWaitFor.push(thisFetchPromise);
            var allUniquePromisesToWaitFor = _.uniq(allPromisesToWaitFor);
            return $.when.apply($, allUniquePromisesToWaitFor)
              // Make it look like the multiple promises was performed by a single request.
              .then(function() {
                // collects the parts of each ajax call into arrays: result = { [data1, data2, ...], [textStatus1, textStatus2, ...], [jqXHR1, jqXHR2, ...] };
                var result = _.zip(arguments);
                // Flatten the data so it looks like the result of a single request.
                var resultData = result[0];
                var flattenedResultData = _.flatten(resultData);
                return flattenedResultData;
              });
          }
function(options) {
            options = options || {};

            //find ids that we don't have in cache and aren't already in the process of being fetched.
            var idsNotInCache = _.difference(this.getTrackedIds(), _.pluck(parentInstance.models, 'id'));
            var idsWithPromises = _.pick(parentInstance.idPromises, idsNotInCache);

            // Determine which ids are already being fetched and the associated promises for those ids.
            options.idsToFetch = _.difference(idsNotInCache, _.uniq(_.flatten(_.keys(idsWithPromises))));
            var thisFetchPromise = this.fetch(options);

            // Return a promise that resolves when all ids are fetched (including pending ids).
            var allPromisesToWaitFor = _.flatten(_.values(idsWithPromises));
            allPromisesToWaitFor.push(thisFetchPromise);
            var allUniquePromisesToWaitFor = _.uniq(allPromisesToWaitFor);
            return $.when.apply($, allUniquePromisesToWaitFor)
              // Make it look like the multiple promises was performed by a single request.
              .then(function() {
                // collects the parts of each ajax call into arrays: result = { [data1, data2, ...], [textStatus1, textStatus2, ...], [jqXHR1, jqXHR2, ...] };
                var result = _.zip(arguments);
                // Flatten the data so it looks like the result of a single request.
                var resultData = result[0];
                var flattenedResultData = _.flatten(resultData);
                return flattenedResultData;
              });
          }
function ( options ) { options = options || { } ; //find ids that we don't have in cache and aren't already in the process of being fetched. var idsNotInCache = _ . difference ( this . getTrackedIds ( ) , _ . pluck ( parentInstance . models , 'id' ) ) ; var idsWithPromises = _ . pick ( parentInstance . idPromises , idsNotInCache ) ; // Determine which ids are already being fetched and the associated promises for those ids. options . idsToFetch = _ . difference ( idsNotInCache , _ . uniq ( _ . flatten ( _ . keys ( idsWithPromises ) ) ) ) ; var thisFetchPromise = this . fetch ( options ) ; // Return a promise that resolves when all ids are fetched (including pending ids). var allPromisesToWaitFor = _ . flatten ( _ . values ( idsWithPromises ) ) ; allPromisesToWaitFor . push ( thisFetchPromise ) ; var allUniquePromisesToWaitFor = _ . uniq ( allPromisesToWaitFor ) ; return $ . when . apply ( $ , allUniquePromisesToWaitFor ) // Make it look like the multiple promises was performed by a single request. . then ( function ( ) { // collects the parts of each ajax call into arrays: result = { [data1, data2, ...], [textStatus1, textStatus2, ...], [jqXHR1, jqXHR2, ...] }; var result = _ . zip ( arguments ) ; // Flatten the data so it looks like the result of a single request. var resultData = result [ 0 ] ; var flattenedResultData = _ . flatten ( resultData ) ; return flattenedResultData ; } ) ; }
Will force the cache to fetch any of this collection's tracked models that are not in the cache
while not fetching models that are already in the cache. Useful when you want the effeciency of
pulling models from the cache and don't need all the models to be up-to-date.

If the ids being fetched are already being fetched by the cache, then they will not be re-fetched.

The resulting promise is resolved when ALL items in the process of being fetched have completed.
The promise will resolve to a unified data property that is a combination of the completion of all of the fetches.

@method requesterMixin.pull
@param [options] {Object} if given, will pass the options argument to this.fetch. Note, will not affect options.idsToFetch
@return {Promise} promise that will resolve when the fetch is complete with all of the data that was fetched from the server.
Will only resolve once all ids have attempted to be fetched from the server.
Will force the cache to fetch any of this collection s tracked models that are not in the cache while not fetching models that are already in the cache . Useful when you want the effeciency of pulling models from the cache and don t need all the models to be up - to - date .