(item: Zotero.Item | { key: string }, key: string, value: any)
| 34 | } |
| 35 | |
| 36 | async set(item: Zotero.Item | { key: string }, key: string, value: any) { |
| 37 | await this.lock.promise; |
| 38 | (this.cache[item.key] ??= {})[key] = value |
| 39 | window.setTimeout(async () => { |
| 40 | await Zotero.File.putContentsAsync(this.filename, JSON.stringify(this.cache)); |
| 41 | }) |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | export default LocalStorage |
no outgoing calls
no test coverage detected