mirror of
https://github.com/ente-io/ente.git
synced 2025-06-25 19:32:26 +00:00
33 lines
648 B
TypeScript
33 lines
648 B
TypeScript
export enum MS_KEYS {
|
|
OPT_OUT_OF_CRASH_REPORTS = "optOutOfCrashReports",
|
|
SRP_CONFIGURE_IN_PROGRESS = "srpConfigureInProgress",
|
|
REDIRECT_URL = "redirectUrl",
|
|
}
|
|
|
|
type StoreType = Map<Partial<MS_KEYS>, any>;
|
|
|
|
class InMemoryStore {
|
|
private store: StoreType = new Map();
|
|
|
|
get(key: MS_KEYS) {
|
|
return this.store.get(key);
|
|
}
|
|
|
|
set(key: MS_KEYS, value: any) {
|
|
this.store.set(key, value);
|
|
}
|
|
|
|
delete(key: MS_KEYS) {
|
|
this.store.delete(key);
|
|
}
|
|
|
|
has(key: MS_KEYS) {
|
|
return this.store.has(key);
|
|
}
|
|
clear() {
|
|
this.store.clear();
|
|
}
|
|
}
|
|
|
|
export default new InMemoryStore();
|