mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-22 22:49:45 +01:00
feat: seperate delta from note storage, improve performance
This commit is contained in:
@@ -11,18 +11,16 @@ export default class Indexer extends Storage {
|
||||
this.indices = (await this.read(this.type)) || [];
|
||||
}
|
||||
|
||||
async exists(key) {
|
||||
return this.indices.includes(key);
|
||||
}
|
||||
|
||||
async index(key) {
|
||||
if (this.indices.length <= 0) {
|
||||
this.indices = (await this.read(this.type)) || [];
|
||||
}
|
||||
this.indices[this.indices.length] = key;
|
||||
await this.write(this.type, this.indices);
|
||||
}
|
||||
|
||||
async getIndices() {
|
||||
if (this.indices.length <= 0) {
|
||||
this.indices = (await this.read(this.type)) || [];
|
||||
}
|
||||
return this.indices;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user