So I’m writing my own data layer to use until ember data meets our performance requirements. So far its working much better, but there is still a noticeable freeze as its processing the data from the xhr requests. Here is what my findAll method looks like:
findAll: function() {
var url = this.url,
newObjects = [],
root = this.root + 's',
self = this;
newObjects.set('isLoaded', false);
if(this.plural) {
root = this.plural;
}
$.getJSON(url).then(function(response) {
var temp = [];
response[root].forEach(function(data) {
temp.addObject(self.create(data));
});
Ember.run(self, function () {
newObjects.addObjects(temp);
newObjects.set('isLoaded', true);
});
});
return newObjects;
}
Is there anything I can do better in this code to get more performance out of it?