import { ITokenModel } from '../token/interface' ; import { IStore } from './interface' ; export function DA_STORE_TOKEN_LOCAL_FACTORY ( ) { return new LocalStorageStore ( ) ; } /**
 * `localStorage` storage, **not lost after closing the browser**.
 *
 * ```ts
 * // global-config.module.ts
 * { provide: DA_STORE_TOKEN, useClass: LocalStorageStore }
 * ```
 */ export class LocalStorageStore implements IStore { get ( key ) { return JSON . parse ( localStorage . getItem ( key ) || '{}' ) || { } ; } set ( key , value ) { localStorage . setItem ( key , JSON . stringify ( value ) ) ; return true ; } remove ( key ) { localStorage . removeItem ( key ) ; } }