@tauri-store/pinia - v3.7.0

    Interface StoreFrontendOptions<S>

    Options that can only be set from JavaScript.

    interface StoreFrontendOptions<S extends State = State> {
        autoStart?: boolean | ((storeId: string) => MaybePromise<boolean>);
        filterKeys?: StoreKeyFilter;
        filterKeysStrategy?: StoreKeyFilterStrategy;
        hooks?: StoreHooks<S>;
        save?: boolean;
        sync?: boolean;
        syncInterval?: number;
        syncStrategy?: LooseTimeStrategyKind;
    }

    Type Parameters

    Index

    Properties

    autoStart?: boolean | ((storeId: string) => MaybePromise<boolean>)

    Whether to automatically start the store.

    false
    
    filterKeys?: StoreKeyFilter

    Keys the plugin should sync or ignore.

    The behavior depends on the value of StoreFrontendOptions.filterKeysStrategy.

    This option is ignored if you set a callback as the filter strategy.

    null
    
    filterKeysStrategy?: StoreKeyFilterStrategy

    Strategy to use when filtering keys.

    • pick: Only the specified keys will be synced.
    • omit: All keys will be synced 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 synced.

    The filtering is shallow, meaning that nested keys will not be filtered.

    'omit'
    
    hooks?: StoreHooks<S>

    Hooks to run custom logic at specific points in the store lifecycle.

    save?: boolean

    Whether this store can be saved. Setting this to false will add the store to the save denylist.

    true
    
    sync?: boolean

    Whether this store can be synced. Setting this to false will add the store to the sync denylist.

    true
    
    syncInterval?: number

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

    0
    
    syncStrategy?: LooseTimeStrategyKind

    Strategy to use when syncing the store with the backend.

    Whenever there's a state change, the store sends a notification to Rust so they can stay in sync. Since data gets serialized every time this happens, it can be expensive to do it too often. To mitigate this, we can use debounce or throttle to control how often this synchronization occurs.

    If the value is a number, the plugin will use debounce with the specified value as the interval. If null or undefined, 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'
    
    MMNEPVFCICPMFPCPTTAAATR