import { injectable } from '@cloudbeaver/core-di' ; import { SettingsSource } from '@cloudbeaver/core-settings' ; @ injectable ( ) export class SessionSettingsService extends SettingsSource { constructor ( private localStorageKey ) { super ( ) ; const state = localStorage . getItem ( this . localStorageKey ) ; if ( state ) { this . store = JSON . parse ( state ) ; } } setValue ( key , value ) { super . setValue ( key , value ) ; localStorage . setItem ( this . localStorageKey , JSON . stringify ( this . store ) ) ; } }