fix delay material fetching
This commit is contained in:
parent
db131d10c0
commit
4ece2cf30c
13 changed files with 220 additions and 143 deletions
14
client/src/app/shared/helpers/asyncStorage.ts
Normal file
14
client/src/app/shared/helpers/asyncStorage.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
export class AsyncStorage {
|
||||
static async getItem<T>(key: string) {
|
||||
return new Promise<T>((resolve) => {
|
||||
resolve(localStorage.getItem(key) as T);
|
||||
});
|
||||
}
|
||||
|
||||
static async setItem(key: string, value: string) {
|
||||
return new Promise<void>((resolve) => {
|
||||
localStorage.setItem(key, value);
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue