mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
23 lines
428 B
JavaScript
23 lines
428 B
JavaScript
|
|
var emptyValue = '';
|
||
|
|
|
||
|
|
Mixins.CachedValue = BlazeComponent.extendComponent({
|
||
|
|
onCreated: function() {
|
||
|
|
this._cachedValue = emptyValue;
|
||
|
|
},
|
||
|
|
|
||
|
|
setCache: function(value) {
|
||
|
|
this._cachedValue = value;
|
||
|
|
},
|
||
|
|
|
||
|
|
getCache: function(defaultValue) {
|
||
|
|
if (this._cachedValue === emptyValue)
|
||
|
|
return defaultValue || '';
|
||
|
|
else
|
||
|
|
return this._cachedValue;
|
||
|
|
},
|
||
|
|
|
||
|
|
resetCache: function() {
|
||
|
|
this.setCache('');
|
||
|
|
}
|
||
|
|
});
|