ios-dev/comments/Home/node_modules/lowdb/lib/adapters/Memory.js

20 lines
337 B
JavaScript
Raw Permalink Normal View History

2024-03-11 14:47:28 +03:00
export class Memory {
#data = null;
read() {
return Promise.resolve(this.#data);
}
write(obj) {
this.#data = obj;
return Promise.resolve();
}
}
export class MemorySync {
#data = null;
read() {
return this.#data || null;
}
write(obj) {
this.#data = obj;
}
}