feat(mobx): add persistence

This commit is contained in:
Paul
2021-12-11 16:24:23 +00:00
parent 24bc0949a4
commit 2eb8801363
12 changed files with 136 additions and 45 deletions

View File

@@ -7,3 +7,11 @@ export function urlBase64ToUint8Array(base64String: string) {
return Uint8Array.from([...rawData].map((char) => char.charCodeAt(0)));
}
export function mapToRecord<K extends symbol | string | number, V>(
map: Map<K, V>,
) {
let record = {} as Record<K, V>;
map.forEach((v, k) => (record[k] = v));
return record;
}