Skip to content

Instantly share code, notes, and snippets.

@bitcartel
Created December 17, 2019 21:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bitcartel/5315954b7f7bf6735a60c2248de23b23 to your computer and use it in GitHub Desktop.
Save bitcartel/5315954b7f7bf6735a60c2248de23b23 to your computer and use it in GitHub Desktop.
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