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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
297 B
JavaScript
Raw Permalink 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];
}
}