Collections
AJAX Abstraction for Lists of Resources
AJAX Abstraction for Lists of Resources
The fetch()
method is used to retrieve a collection of resources.
You can learn about how this method can be used to retrieve resources here.
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);
},