src/client/app/modules/core/interfaces/istorage.ts
Methods |
getItem |
getItem(key: StorageKey)
|
Returns :
any
|
removeItem |
removeItem(key: StorageKey)
|
Returns :
void
|
setItem |
setItem(key: StorageKey, value: any)
|
Returns :
void
|
export interface IStorage {
setItem(key: StorageKey, value: any): void;
getItem(key: StorageKey): any;
removeItem(key: StorageKey): void;
}
// to limit interaction with localStorage to a certain whitelist, you can list those keys here
export enum StorageKey {
USERNAME,
LANGUAGE
}