You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
consul/ui/packages/consul-ui/app/storages/base.js

20 lines
341 B

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
export default class Storage {
constructor(key, storage) {
this.key = key;
this.storage = storage;
this.state = this.initState(this.key, this.storage);
}
initState() {
const { key, storage } = this;
return storage.getItem(key);
}
}