mirror of
https://github.com/status-im/consul.git
synced 2025-01-10 05:45:46 +00:00
c450183b4c
Use local-storage service, prototyped here https://github.com/LevelbossMike/local-storage-service, to manage local storage usage in an octane way. Does not write to local storage in tests by default and is easy to stub out.
15 lines
263 B
JavaScript
15 lines
263 B
JavaScript
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);
|
|
}
|
|
}
|