File size: 489 Bytes
a2b2aac |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
const { MissingAdapterError } = require('./MissingAdapterError.js');
class Low {
constructor(adapter) {
this.data = null;
if (adapter) {
this.adapter = adapter;
}
else {
throw new MissingAdapterError();
}
}
async read() {
this.data = await this.adapter.read();
}
async write() {
if (this.data) {
await this.adapter.write(this.data);
}
}
}
module.exports = { Low };
|