Skip to content

Commit

Permalink
backout _push run.join change
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired committed Dec 6, 2016
1 parent 23a824b commit 120df47
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions addon/-private/system/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -2277,39 +2277,37 @@ Store = Service.extend({
*/
_push(apiDoc) {
let token = heimdall.start('store._push');
return this._backburner.join(() => {
let included = apiDoc.included;
let i, length;
let included = apiDoc.included;
let i, length;

if (included) {
for (i = 0, length = included.length; i < length; i++) {
this._pushInternalModel(included[i]);
}
if (included) {
for (i = 0, length = included.length; i < length; i++) {
this._pushInternalModel(included[i]);
}
}

if (Array.isArray(apiDoc.data)) {
length = apiDoc.data.length;
let internalModels = new Array(length);
if (Array.isArray(apiDoc.data)) {
length = apiDoc.data.length;
let internalModels = new Array(length);

for (i = 0; i < length; i++) {
internalModels[i] = this._pushInternalModel(apiDoc.data[i]);
}
heimdall.stop(token);
return internalModels;
for (i = 0; i < length; i++) {
internalModels[i] = this._pushInternalModel(apiDoc.data[i]);
}
heimdall.stop(token);
return internalModels;
}

if (apiDoc.data === null) {
heimdall.stop(token);
return null;
}
if (apiDoc.data === null) {
heimdall.stop(token);
return null;
}

assert(`Expected an object in the 'data' property in a call to 'push' for ${apiDoc.type}, but was ${typeOf(apiDoc.data)}`, typeOf(apiDoc.data) === 'object');
assert(`Expected an object in the 'data' property in a call to 'push' for ${apiDoc.type}, but was ${typeOf(apiDoc.data)}`, typeOf(apiDoc.data) === 'object');

let internalModel = this._pushInternalModel(apiDoc.data);
let internalModel = this._pushInternalModel(apiDoc.data);

heimdall.stop(token);
return internalModel;
});
heimdall.stop(token);
return internalModel;
},

_hasModelFor(modelName) {
Expand Down Expand Up @@ -2350,7 +2348,9 @@ Store = Service.extend({
// Actually load the record into the store.
let internalModel = this._load(data);

this._setupRelationshipsForModel(internalModel, data);
this._backburner.join(() => {
this._setupRelationshipsForModel(internalModel, data);
});

return internalModel;
},
Expand Down

0 comments on commit 120df47

Please sign in to comment.