Use store instead of `store_builder` in example

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

@ -70,7 +70,7 @@ Afterwards all the plugin's APIs are available through the JavaScript guest bind
```typescript ```typescript
import { LazyStore } from '@tauri-apps/plugin-store' import { LazyStore } from '@tauri-apps/plugin-store'
const store = new LazyStore('.settings.dat') const store = new LazyStore('settings.json')
await store.set('some-key', { value: 5 }) await store.set('some-key', { value: 5 })
@ -113,7 +113,7 @@ fn main() {
.plugin(tauri_plugin_store::Builder::default().build()) .plugin(tauri_plugin_store::Builder::default().build())
.setup(|app| { .setup(|app| {
// This loads the store from disk // This loads the store from disk
let store = app.store_builder("app_data.bin").build()?; let store = app.store("app_data.json");
// Note that values must be serde_json::Value instances, // Note that values must be serde_json::Value instances,
// otherwise, they will not be compatible with the JavaScript bindings. // otherwise, they will not be compatible with the JavaScript bindings.

@ -17,7 +17,7 @@ fn main() {
.plugin(tauri_plugin_store::Builder::new().build()) .plugin(tauri_plugin_store::Builder::new().build())
.setup(|app| { .setup(|app| {
// Init store and load it from disk // Init store and load it from disk
let store = app.handle().store_builder("settings.json").build().unwrap(); let store = app.store("settings.json");
app.listen("store://change", |event| { app.listen("store://change", |event| {
dbg!(event); dbg!(event);
}); });

Loading…
Cancel
Save