import { BaseKVStore } from "./base" ; import { KVStoreProvider } from "./interface" ; class MemoryKVStoreProvider implements KVStoreProvider { private store : { [ key ] : any ; } = { } ; get ( ) { return Promise . resolve ( this . store ) ; } set ( items ) { this . store = { ... this . store , ... items } ; return Promise . resolve ( ) ; } } export class MemoryKVStore extends BaseKVStore { constructor ( prefix ) { super ( new MemoryKVStoreProvider ( ) , prefix ) ; } }