REFACTOR: Remove a couple more `self` uses

This commit is contained in:
Robin Ward 2019-01-30 14:41:49 -05:00
parent dca5486b78
commit bb8808985a
2 changed files with 3 additions and 9 deletions

View File

@ -25,12 +25,9 @@ export default Ember.ArrayProxy.extend({
if (this.get("length") < totalRows && !this.get("loadingMore")) {
this.set("loadingMore", true);
const self = this;
return this.store
.appendResults(this, this.get("__type"), loadMoreUrl)
.finally(function() {
self.set("loadingMore", false);
});
.finally(() => this.set("loadingMore", false));
}
return Ember.RSVP.resolve();
@ -46,12 +43,9 @@ export default Ember.ArrayProxy.extend({
return;
}
const self = this;
this.set("refreshing", true);
return this.store
.refreshResults(this, this.get("__type"), refreshUrl)
.finally(function() {
self.set("refreshing", false);
});
.finally(() => this.set("refreshing", false));
}
});

View File

@ -156,7 +156,7 @@ export default Ember.Object.extend({
},
appendResults(resultSet, type, url) {
return ajax(url).then(function(result) {
return ajax(url).then(result => {
let typeName = Ember.String.underscore(this.pluralize(type));
let pageTarget = result.meta || result;