Skip to content

Commit

Permalink
chore: remove dead sinceToken code (#6163)
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired authored Jun 17, 2019
1 parent 0fd3d10 commit 8d621d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions packages/store/addon/-private/system/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -1970,7 +1970,6 @@ const Store = Service.extend({
*/
_fetchAll(modelName, array, options = {}) {
let adapter = this.adapterFor(modelName);
let sinceToken = this._internalModelsFor(modelName).metadata.since;

assert(`You tried to load all records but you have no adapter (for ${modelName})`, adapter);
assert(
Expand All @@ -1980,14 +1979,14 @@ const Store = Service.extend({

if (options.reload) {
set(array, 'isUpdating', true);
return promiseArray(_findAll(adapter, this, modelName, sinceToken, options));
return promiseArray(_findAll(adapter, this, modelName, options));
}

let snapshotArray = array._createSnapshot(options);

if (adapter.shouldReloadAll(this, snapshotArray)) {
set(array, 'isUpdating', true);
return promiseArray(_findAll(adapter, this, modelName, sinceToken, options));
return promiseArray(_findAll(adapter, this, modelName, options));
}

if (options.backgroundReload === false) {
Expand All @@ -1996,7 +1995,7 @@ const Store = Service.extend({

if (options.backgroundReload || adapter.shouldBackgroundReloadAll(this, snapshotArray)) {
set(array, 'isUpdating', true);
_findAll(adapter, this, modelName, sinceToken, options);
_findAll(adapter, this, modelName, options);
}

return promiseArray(Promise.resolve(array));
Expand Down
4 changes: 2 additions & 2 deletions packages/store/addon/-private/system/store/finders.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,12 @@ export function _findBelongsTo(adapter, store, internalModel, link, relationship
);
}

export function _findAll(adapter, store, modelName, sinceToken, options) {
export function _findAll(adapter, store, modelName, options) {
let modelClass = store.modelFor(modelName); // adapter.findAll depends on the class
let recordArray = store.peekAll(modelName);
let snapshotArray = recordArray._createSnapshot(options);
let promise = Promise.resolve().then(() =>
adapter.findAll(store, modelClass, sinceToken, snapshotArray)
adapter.findAll(store, modelClass, null, snapshotArray)
);
let label = 'DS: Handle Adapter#findAll of ' + modelClass;

Expand Down

0 comments on commit 8d621d9

Please sign in to comment.