mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-12 23:04:52 +09:00
Give restore abilty to memory provider
This commit is contained in:
1 file changed
+8
-1
@@ -28,11 +28,18 @@ export class MemoryDatastoreProvider<
|
||||
K extends DatastoreKey,
|
||||
V extends DatastoreValue,
|
||||
> extends DatastoreProvider<K, V> {
|
||||
constructor(
|
||||
private value: Map<K, V> = new Map()
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
async save(data: Map<K, V>) {
|
||||
this.value = new Map(data);
|
||||
}
|
||||
|
||||
async load() {
|
||||
return new Map();
|
||||
return new Map(this.value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user