Class SnapshotRecordArray
publicSnapshotRecordArray is not directly instantiable. Instances are provided to consuming application's adapters for certain requests.
adapterOptions public
Defined in ../packages/legacy-compat/src/legacy-network-handler/snapshot-record-array.ts:64
A hash of adapter options passed into the store method for this request.
Example
import MyCustomAdapter from './custom-adapter';
export default class PostAdapter extends MyCustomAdapter {
findAll(store, type, sinceToken, snapshotRecordArray) {
if (snapshotRecordArray.adapterOptions.subscribe) {
// ...
}
// ...
}
}
include public
Defined in ../packages/legacy-compat/src/legacy-network-handler/snapshot-record-array.ts:88
The relationships to include for this request.
Example
import Adapter from '@ember-data/adapter';
export default class ApplicationAdapter extends Adapter {
findAll(store, type, snapshotRecordArray) {
let url = `/${type.modelName}?include=${encodeURIComponent(snapshotRecordArray.include)}`;
return fetch(url).then((response) => response.json())
}
}
length public
Defined in ../packages/legacy-compat/src/legacy-network-handler/snapshot-record-array.ts:123
Number of records in the array
Example
import JSONAPIAdapter from '@ember-data/adapter/json-api';
export default class PostAdapter extends JSONAPIAdapter {
shouldReloadAll(store, snapshotRecordArray) {
return !snapshotRecordArray.length;
}
});
modelName public
Defined in ../packages/legacy-compat/src/legacy-network-handler/snapshot-record-array.ts:56
The modelName of the underlying records for the snapshots in the array, as a Model