mirror of
https://git.um-react.app/um/web.git
synced 2025-12-16 12:13:02 +00:00
feat: add basic joox support
(cherry picked from commit 699333ca06526d747a7eb4a188e896de81e9f014)
This commit is contained in:
14
src/utils/storage/BaseStorage.ts
Normal file
14
src/utils/storage/BaseStorage.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
const KEY_JOOX_UUID = 'joox.uuid';
|
||||
|
||||
export default abstract class BaseStorage {
|
||||
protected abstract save<T>(name: string, value: T): Promise<void>;
|
||||
protected abstract load<T>(name: string, defaultValue: T): Promise<T>;
|
||||
|
||||
public saveJooxUUID(uuid: string): Promise<void> {
|
||||
return this.save(KEY_JOOX_UUID, uuid);
|
||||
}
|
||||
|
||||
public loadJooxUUID(defaultValue: string = ''): Promise<string> {
|
||||
return this.load(KEY_JOOX_UUID, defaultValue);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user