Update readme

pull/1860/head
Tony 8 months ago
parent 3127ce562b
commit 7aca255209
No known key found for this signature in database
GPG Key ID: 34BDD3EA27824956

@ -68,9 +68,9 @@ fn main() {
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
```typescript
import { LazyStore } from '@tauri-apps/plugin-store'
import { createStore } from '@tauri-apps/plugin-store'
const store = new LazyStore('settings.json')
const store = await createStore('settings.json')
await store.set('some-key', { value: 5 })
@ -100,6 +100,16 @@ However, you can also load them manually later like so:
await store.load()
```
### LazyStore
There's also a high level API `LazyStore` which only loads the store on first access, note that the options will be ignored if a `Store` with that path has already been created
```typescript
import { LazyStore } from '@tauri-apps/plugin-store'
const store = new LazyStore('settings.json')
```
## Usage from Rust
You can also create `Store` instances directly in Rust:

Loading…
Cancel
Save