mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 15:09:33 +01:00
23 lines
461 B
JavaScript
23 lines
461 B
JavaScript
import Convert from "../utils/convert";
|
|
|
|
class Storage {
|
|
constructor(context) {
|
|
this.storage = context;
|
|
}
|
|
async write(key, data) {
|
|
await this.storage.write(key, Convert.toString(data));
|
|
}
|
|
async read(key) {
|
|
let data = await this.storage.read(key);
|
|
return Convert.fromString(data);
|
|
}
|
|
clear() {
|
|
this.storage.clear(); //TODO add test
|
|
}
|
|
remove(key) {
|
|
this.storage.remove(key); //TODO add test
|
|
}
|
|
}
|
|
|
|
export default Storage;
|