diff --git a/plugins/store/guest-js/index.ts b/plugins/store/guest-js/index.ts index b943b0f2..7f259230 100644 --- a/plugins/store/guest-js/index.ts +++ b/plugins/store/guest-js/index.ts @@ -29,7 +29,7 @@ export class Store { * @returns */ async set(key: string, value: unknown): Promise { - await invoke("plugin:store|set", { + return await invoke("plugin:store|set", { path: this.path, key, value, @@ -115,7 +115,7 @@ export class Store { * * @returns */ - async values(): Promise { + async values(): Promise { return await invoke("plugin:store|values", { path: this.path, }); @@ -137,7 +137,7 @@ export class Store { * * @returns */ - async length(): Promise { + async length(): Promise { return await invoke("plugin:store|length", { path: this.path, }); @@ -160,8 +160,8 @@ export class Store { /** * Saves the store to disk at the stores `path`. * - * As the store is only persistet to disk before the apps exit, changes might be lost in a crash. - * This method let's you persist the store to disk whenever you deem necessary. + * As the store is only persisted to disk before the apps exit, changes might be lost in a crash. + * This method lets you persist the store to disk whenever you deem necessary. * @returns */ async save(): Promise { @@ -196,7 +196,7 @@ export class Store { * @returns A promise resolving to a function to unlisten to the event. */ async onChange( - cb: (key: string, value: unknown) => void + cb: (key: string, value: T | null) => void ): Promise { return await appWindow.listen>( "store://change",