Give restore abilty to memory provider

This commit is contained in:
Cooldude2606 committed 2024-05-22 17:42:25 +01:00
1 parent af50cfd47a
commit 94a07b5af4
1 file changed
+8 -1
+8 -1
View File
@@ -28,11 +28,18 @@ export class MemoryDatastoreProvider<
K extends DatastoreKey, K extends DatastoreKey,
V extends DatastoreValue, V extends DatastoreValue,
> extends DatastoreProvider<K, V> { > extends DatastoreProvider<K, V> {
constructor(
private value: Map<K, V> = new Map()
) {
super();
}
async save(data: Map<K, V>) { async save(data: Map<K, V>) {
this.value = new Map(data);
} }
async load() { async load() {
return new Map(); return new Map(this.value);
} }
} }