updates instances of overriding computed properties (#14675)

This commit is contained in:
Jordan Reimer
2022-03-24 09:30:19 -06:00
committed by GitHub
parent f9863f8fff
commit 0bd8748dca
2 changed files with 16 additions and 5 deletions

View File

@@ -35,9 +35,14 @@ export default Service.extend({
clusterAdapter() {
return getOwner(this).lookup('adapter:cluster');
},
tokens: computed(function () {
return this.getTokensFromStorage() || [];
// eslint-disable-next-line
tokens: computed({
get() {
return this._tokens || this.getTokensFromStorage() || [];
},
set(key, value) {
return (this._tokens = value);
},
}),
generateTokenName({ backend, clusterId }, policies) {

View File

@@ -29,8 +29,14 @@ export function keyForCache(query) {
export default Store.extend({
// this is a map of map that stores the caches
lazyCaches: computed(function () {
return new Map();
// eslint-disable-next-line
lazyCaches: computed({
get() {
return this._lazyCaches || new Map();
},
set(key, value) {
return (this._lazyCaches = value);
},
}),
setLazyCacheForModel(modelName, key, value) {