gitlab-org--gitlab-foss/app/assets/javascripts/lib/utils/cache.js

18 lines
297 B
JavaScript
Raw Normal View History

export default class Cache {
2017-05-16 06:01:23 -04:00
constructor() {
2018-10-10 02:25:43 -04:00
this.internalStorage = {};
2017-05-16 06:01:23 -04:00
}
get(key) {
return this.internalStorage[key];
}
hasData(key) {
return Object.prototype.hasOwnProperty.call(this.internalStorage, key);
}
remove(key) {
delete this.internalStorage[key];
}
}