Class SnapshotRecordArray

public

SnapshotRecordArray is not directly instantiable. Instances are provided to consuming application's adapters for certain findAll requests.

Show:

returns
Array

Array of snapshots

Get snapshots of the underlying record array

Example

app/adapters/post.js
import JSONAPIAdapter from '@ember-data/adapter/json-api';

export default class PostAdapter extends JSONAPIAdapter {
  shouldReloadAll(store, snapshotArray) {
    let snapshots = snapshotArray.snapshots();

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