Class SnapshotRecordArray
public
Module:
@ember-data/store
SnapshotRecordArray is not directly instantiable. Instances are provided to consuming application's adapters for certain requests.
snapshots Array public
Module:
@ember-data/store
Defined in ../store/addon/-private/system/snapshot-record-array.ts:168
- returns
- Array
- Array of snapshots
Get snapshots of the underlying record array
Example
app/adapters/post.js | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import JSONAPIAdapter from ' -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; } }); } } |