API Docs for: 5.4.0-beta.5+07ce8abc
Show:

RecordArray Class

A record array is an array that contains records of a certain type (or modelName). The record array materializes records as needed when they are retrieved for the first time. You should not create record arrays yourself. Instead, an instance of RecordArray or its subclasses will be returned by your application's store in response to queries.

This class should not be imported and instantiated by consuming applications.

Item Index

Methods

Properties

Methods

save

() Promise public

Saves all of the records in the RecordArray.

Example

let messages = store.peekAll('message');
messages.forEach(function(message) {
  message.hasBeenSeen = true;
});
messages.save();

Returns:

Promise:

promise

update

() public

Used to get the latest version of all of the records in this array from the adapter.

Example

let people = store.peekAll('person');
people.isUpdating; // false

people.update().then(function() {
  people.isUpdating; // false
});

people.isUpdating; // true

Properties

isUpdating

Boolean public

The flag to signal a RecordArray is currently loading data. Example

let people = store.peekAll('person');
people.isUpdating; // false
people.update();
people.isUpdating; // true

store

Store private

The store that created this record array.