Created
December 17, 2019 21:07
-
-
Save bitcartel/5315954b7f7bf6735a60c2248de23b23 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Database extends Jig { | |
get(key) { return this[key] } | |
set(key, value) { this[key] = value } | |
} | |
class MemDatabase { | |
constructor() { this.database = new Database(); this.kv = {} } | |
load() { this.kv = this.database.get('db') } | |
save() { this.database.set('db', this.kv) } | |
get(key) { return this.kv[key] } | |
set(key, value) { this.kv[key] = value } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment