Skip to content

Commit 9751296

Browse files
committed
Update docs
1 parent bf5a191 commit 9751296

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

plugins/store/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ fn main() {
6868
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
6969

7070
```typescript
71-
import { createStore } from '@tauri-apps/plugin-store'
71+
import { Store } from '@tauri-apps/plugin-store'
7272

73-
const store = await createStore('settings.json')
73+
const store = await Store.load('settings.json')
7474

7575
await store.set('some-key', { value: 5 })
7676

plugins/store/guest-js/index.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,7 @@ export async function create(
6565
* @example
6666
* ```typescript
6767
* import { Store } from '@tauri-apps/api/store';
68-
* let store = await Store.get('store.json');
69-
* if (!store) {
70-
* store = await Store.load('store.json');
71-
* }
68+
* const store = await Store.load('store.json');
7269
* ```
7370
*
7471
* @param path Path to save the store in `app_data_dir`
@@ -93,10 +90,7 @@ export async function load(
9390
* @example
9491
* ```typescript
9592
* import { getStore } from '@tauri-apps/api/store';
96-
* let store = await getStore('store.json');
97-
* if (!store) {
98-
* store = await Store.load('store.json');
99-
* }
93+
* const store = await getStore('store.json');
10094
* ```
10195
*
10296
* @param path Path of the store.
@@ -245,10 +239,7 @@ export class Store extends Resource implements IStore {
245239
* @example
246240
* ```typescript
247241
* import { Store } from '@tauri-apps/api/store';
248-
* let store = await Store.get('store.json');
249-
* if (!store) {
250-
* store = await Store.load('store.json');
251-
* }
242+
* const store = await Store.load('store.json');
252243
* ```
253244
*
254245
* @param path Path to save the store in `app_data_dir`

0 commit comments

Comments
 (0)