mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-23 11:36:13 +02:00
Apply suggestions from code review
This commit is contained in:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user