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() { clusterAdapter() {
return getOwner(this).lookup('adapter:cluster'); return getOwner(this).lookup('adapter:cluster');
}, },
// eslint-disable-next-line
tokens: computed(function () { tokens: computed({
return this.getTokensFromStorage() || []; get() {
return this._tokens || this.getTokensFromStorage() || [];
},
set(key, value) {
return (this._tokens = value);
},
}), }),
generateTokenName({ backend, clusterId }, policies) { generateTokenName({ backend, clusterId }, policies) {

View File

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