Collections

AJAX Abstraction for Lists of Resources

fetch

The fetch() method is used to retrieve a collection of resources.

Usage

You can learn about how this method can be used to retrieve resources here.

Default Implementation

The default implementation looks like this:

// Fetch the default set of models for this collection, resetting the
// collection when they arrive.
fetch: function(options) {
  options = _.extend({ parse: true }, options);

  // Reset the default models
  const collection = this;
  options.success = function(attributes) {
    collection.reset(attributes, options);
  };

  return this.sync('read', this, options);
},