home
  • Blog
  • Home
  • Projects
    • Ember
    • EmberData
    • Ember CLI
2.18
  • Packages
    • ember-data
  • Classes
    • DS.AbortError
    • DS.Adapter
    • DS.AdapterError
    • DS.AdapterPopulatedRecordArray
    • DS.BelongsToReference
    • DS.BooleanTransform
    • DS.BuildURLMixin
    • DS.ConflictError
    • DS.DateTransform
    • DS.EmbeddedRecordsMixin
    • DS.Errors
    • DS.FilteredRecordArray
    • DS.ForbiddenError
    • DS.HasManyReference
    • DS.InvalidError
    • DS.JSONAPIAdapter
    • DS.JSONAPISerializer
    • DS.JSONSerializer
    • DS.ManyArray
    • DS.Model
    • DS.NotFoundError
    • DS.NumberTransform
    • DS.PromiseArray
    • DS.PromiseManyArray
    • DS.PromiseObject
    • DS.RESTAdapter
    • DS.RESTSerializer
    • DS.RecordArray
    • DS.RecordReference
    • DS.RootState
    • DS.Serializer
    • DS.ServerError
    • DS.Store
    • DS.StringTransform
    • DS.TimeoutError
    • DS.Transform
    • DS.UnauthorizedError
    • Ember.Inflector

Class DS.SnapshotRecordArray private


Defined in: addon/-private/system/snapshot-record-array.js:5
Module: ember-data


Methods

snapshots : Array

Module: ember-data

Defined in addon/-private/system/snapshot-record-array.js:129

returns
Array

Array of snapshots

Get snapshots of the underlying record array

Example

app/adapters/post.js
import DS from 'ember-data'

export default DS.JSONAPIAdapter.extend({
  shouldReloadAll(store, snapshotArray) {
    var snapshots = snapshotArray.snapshots();

    return snapshots.any(function(ticketSnapshot) {
      var timeDiff = moment().diff(ticketSnapshot.attr('lastAccessedAt'), 'minutes');
      if (timeDiff > 20) {
        return true;
      } else {
        return false;
      }
    });
  }
});

Properties

adapterOptions

Module: ember-data

Defined in addon/-private/system/snapshot-record-array.js:75

A hash of adapter options passed into the store method for this request.

Example

app/adapters/post.js
import MyCustomAdapter from './custom-adapter';

export default MyCustomAdapter.extend({
  findAll(store, type, sinceToken, snapshotRecordArray) {
    if (snapshotRecordArray.adapterOptions.subscribe) {
      // ...
    }
    // ...
  }
});

include

Module: ember-data

Defined in addon/-private/system/snapshot-record-array.js:98

The relationships to include for this request.

Example

```js {data-filename=app/adapters/application.js} import DS from 'ember-data';

export default DS.Adapter.extend({ findAll(store, type, snapshotRecordArray) { var url = /${type.modelName}?include=${encodeURIComponent(snapshotRecordArray.include)};

return fetch(url).then((response) => response.json())

} });

length

Module: ember-data

Defined in addon/-private/system/snapshot-record-array.js:31

Number of records in the array

Example

app/adapters/post.js
import DS from 'ember-data'

export default DS.JSONAPIAdapter.extend({
  shouldReloadAll(store, snapshotRecordArray) {
    return !snapshotRecordArray.length;
  },
});

meta

Module: ember-data

Defined in addon/-private/system/snapshot-record-array.js:53

Meta objects for the record array.

Example

app/adapters/post.js
import DS from 'ember-data'

export default DS.JSONAPIAdapter.extend({
  shouldReloadAll(store, snapshotRecordArray) {
    var lastRequestTime = snapshotRecordArray.meta.lastRequestTime;
    var twentyMinutes = 20 * 60 * 1000;
    return Date.now() > lastRequestTime + twentyMinutes;
  },
});

type

Module: ember-data

Defined in addon/-private/system/snapshot-record-array.js:120

The type of the underlying records for the snapshots in the array, as a DS.Model

On this page


Methods

  • snapshots

Properties

  • adapterOptions
  • include
  • length
  • meta
  • type
Team Sponsors Security Legal Branding Community Guidelines
Twitter GitHub Discord Mastodon

If you want help you can contact us by email, open an issue, or get realtime help by joining the Ember Discord.

© Copyright 2026 - Tilde Inc.
Ember.js is free, open source and always will be.


Ember is generously supported by
blue Created with Sketch.