shouldBackgroundReloadAll (store, snapshotRecordArray) Boolean
This method is used by the store to determine if the store should reload a record array after the store.findAll method resolves with a cached record array.
This method is only checked by the store when the store is returning a cached record array.
If this method returns true the store will re-fetch all records from the adapter.
For example, if you do not want to fetch complex data over a mobile connection, or if the network is down, you can implement shouldBackgroundReloadAll as follows:
shouldBackgroundReloadAll: function(store, snapshotArray) {
var connection = window.navigator.connection;
if (connection === 'cellular' || connection === 'none') {
return false;
} else {
return true;
}
}
By default this method returns true, indicating that a background reload should always be triggered.
Parameters:
-
store
DS.Store -
snapshotRecordArray
DS.SnapshotRecordArray
Returns:
-
Boolean
Please login to continue.