diff --git a/plugins/store/README.md b/plugins/store/README.md index 2d47434a..8e04d394 100644 --- a/plugins/store/README.md +++ b/plugins/store/README.md @@ -50,15 +50,20 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: -```javascript +```typescript import { Store } from "tauri-plugin-store-api"; const store = new Store(".settings.dat"); await store.set("some-key", { value: 5 }); -const val = await store.get("some-key"); -assert(val, { value: 5 }); +const val = await store.get<{ value: number }>("some-key"); + +if (val) { + console.log(val); +} else { + console.log("val is null"); +} await store.save(); // this manually saves the store, otherwise the store is only saved when your app is closed ```