mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-22 08:13:12 +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,
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user