lib/util/collection.js
function Collection(response, dispatcher, dispatchOptions) {
  if (!Collection.isCollectionResponse(response)) {
    throw new Error(
        'Cannot create Collection from response that does not have resources');
  }

  this.data = response.data;
  this._response = response;
  this._dispatcher = dispatcher;
  this._dispatchOptions = dispatchOptions;
}
function Collection(response, dispatcher, dispatchOptions) {
  if (!Collection.isCollectionResponse(response)) {
    throw new Error(
        'Cannot create Collection from response that does not have resources');
  }

  this.data = response.data;
  this._response = response;
  this._dispatcher = dispatcher;
  this._dispatchOptions = dispatchOptions;
}
function Collection ( response , dispatcher , dispatchOptions ) { if ( ! Collection . isCollectionResponse ( response ) ) { throw new Error ( 'Cannot create Collection from response that does not have resources' ) ; } this . data = response . data ; this . _response = response ; this . _dispatcher = dispatcher ; this . _dispatchOptions = dispatchOptions ; }
Create a Collection object from a response containing a list of resources.

@param {Object} response Full payload from a response to a
collection request.
@param {Dispatcher} dispatcher
@param {Object} [dispatchOptions]
@returns {Object} Collection
Create a Collection object from a response containing a list of resources .