File tree Expand file tree Collapse file tree 2 files changed +5
-14
lines changed Expand file tree Collapse file tree 2 files changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -68,9 +68,9 @@ fn main() {
68
68
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
69
69
70
70
``` typescript
71
- import { createStore } from ' @tauri-apps/plugin-store'
71
+ import { Store } from ' @tauri-apps/plugin-store'
72
72
73
- const store = await createStore (' settings.json' )
73
+ const store = await Store . load (' settings.json' )
74
74
75
75
await store .set (' some-key' , { value: 5 })
76
76
Original file line number Diff line number Diff line change @@ -65,10 +65,7 @@ export async function create(
65
65
* @example
66
66
* ```typescript
67
67
* 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');
72
69
* ```
73
70
*
74
71
* @param path Path to save the store in `app_data_dir`
@@ -93,10 +90,7 @@ export async function load(
93
90
* @example
94
91
* ```typescript
95
92
* 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');
100
94
* ```
101
95
*
102
96
* @param path Path of the store.
@@ -245,10 +239,7 @@ export class Store extends Resource implements IStore {
245
239
* @example
246
240
* ```typescript
247
241
* 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');
252
243
* ```
253
244
*
254
245
* @param path Path to save the store in `app_data_dir`
You can’t perform that action at this time.
0 commit comments