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

View File

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