InterfaceTauriPluginPiniaStoreOptions

interface TauriPluginPiniaStoreOptions {
    deep?: boolean;
    filterKeys?: StoreKeyFilter;
    filterKeysStrategy?: StoreKeyFilterStrategy;
    onError?: ((error: unknown) => MaybePromise<void>);
    syncInterval?: number;
    syncStrategy?:
        | null
        | number
        | "debounce"
        | "throttle"
        | "immediate";
}

Hierarchy (view full)

Properties

deep?: boolean
true
filterKeys?: StoreKeyFilter

Keys the plugin should save or ignore.

The behavior depends on the value of TauriPluginPiniaStoreOptions.filterKeysStrategy.

filterKeysStrategy?: StoreKeyFilterStrategy

Strategy to use when filtering keys.

  • pick: Only the specified keys will be synced and saved.
  • omit: All keys will be synced and saved except the ones specified.

You can also provide a custom function that will be called for each key. If the function returns true, the key will be saved and synced.

'omit'
onError?: ((error: unknown) => MaybePromise<void>)

Custom error handler.

console.error
syncInterval?: number

Interval in milliseconds to use when syncing the store with the backend. This option is only valid when TauriPluginPiniaOptions.syncStrategy is set to debounce or throttle.

0
syncStrategy?:
    | null
    | number
    | "debounce"
    | "throttle"
    | "immediate"

Strategy to use when syncing the store with the backend.

If the value is a number, the plugin will use debounce with the specified value as the interval. If null, the strategy will be immediate.

For a detailed explanation about the differences between debounce and throttle, see: https://kettanaito.com/blog/debounce-vs-throttle

'immediate'