mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-10-10 22:38:44 +02:00
Update docs
This commit is contained in:
2 files changed
+5
-14
No files matched your search
@@ -68,9 +68,9 @@ fn main() {
|
|||||||
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
|
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { createStore } from '@tauri-apps/plugin-store'
|
import { Store } from '@tauri-apps/plugin-store'
|
||||||
|
|
||||||
const store = await createStore('settings.json')
|
const store = await Store.load('settings.json')
|
||||||
|
|
||||||
await store.set('some-key', { value: 5 })
|
await store.set('some-key', { value: 5 })
|
||||||
|
|
||||||
|
|||||||
@@ -65,10 +65,7 @@ export async function create(
|
|||||||
* @example
|
* @example
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import { Store } from '@tauri-apps/api/store';
|
* import { Store } from '@tauri-apps/api/store';
|
||||||
* let store = await Store.get('store.json');
|
* const store = await Store.load('store.json');
|
||||||
* if (!store) {
|
|
||||||
* store = await Store.load('store.json');
|
|
||||||
* }
|
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @param path Path to save the store in `app_data_dir`
|
* @param path Path to save the store in `app_data_dir`
|
||||||
@@ -93,10 +90,7 @@ export async function load(
|
|||||||
* @example
|
* @example
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import { getStore } from '@tauri-apps/api/store';
|
* import { getStore } from '@tauri-apps/api/store';
|
||||||
* let store = await getStore('store.json');
|
* const store = await getStore('store.json');
|
||||||
* if (!store) {
|
|
||||||
* store = await Store.load('store.json');
|
|
||||||
* }
|
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @param path Path of the store.
|
* @param path Path of the store.
|
||||||
@@ -245,10 +239,7 @@ export class Store extends Resource implements IStore {
|
|||||||
* @example
|
* @example
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import { Store } from '@tauri-apps/api/store';
|
* import { Store } from '@tauri-apps/api/store';
|
||||||
* let store = await Store.get('store.json');
|
* const store = await Store.load('store.json');
|
||||||
* if (!store) {
|
|
||||||
* store = await Store.load('store.json');
|
|
||||||
* }
|
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @param path Path to save the store in `app_data_dir`
|
* @param path Path to save the store in `app_data_dir`
|
||||||
|
|||||||
Reference in new issue
Block a user