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() {
6868Afterwards 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
7575await store .set (' some-key' , { value: 5 })
7676
Original file line number Diff line number Diff 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`
You can’t perform that action at this time.
0 commit comments