Apply suggestions from code review

pull/1860/head
Tony 8 months ago
parent c7094473eb
commit 230e6bbdf3
No known key found for this signature in database
GPG Key ID: 34BDD3EA27824956

@ -57,7 +57,7 @@
async function close() {
try {
await store.close();
onMessage("Store is now closed, any new operations will now errors out");
onMessage("Store is now closed, any new operations will error out");
} catch (error) {
onMessage(error);
}

@ -85,7 +85,7 @@ if (val) {
### Persisting Values
Modifications mode to the store are automatically saved by defaut
Modifications made to the store are automatically saved by default
You can manually save a store with:

@ -167,10 +167,7 @@ export class LazyStore implements IStore {
* A key-value store persisted by the backend layer.
*/
export class Store extends Resource implements IStore {
private constructor(
rid: number
// private readonly path: string
) {
private constructor(rid: number) {
super(rid)
}
@ -188,10 +185,7 @@ export class Store extends Resource implements IStore {
path,
...options
})
return new Store(
rid
// path
)
return new Store(rid)
}
/**
@ -208,10 +202,7 @@ export class Store extends Resource implements IStore {
path,
...options
})
return new Store(
rid
// path
)
return new Store(rid)
}
/**
@ -219,12 +210,7 @@ export class Store extends Resource implements IStore {
*/
static async getStore(path: string): Promise<Store | undefined> {
const rid = await invoke<number | null>('plugin:store|get_store', { path })
return rid
? new Store(
rid
// path
)
: undefined
return rid ? new Store(rid) : undefined
}
async set(key: string, value: unknown): Promise<void> {

Loading…
Cancel
Save