@tauri-store/zustand - v0.1.0
    Preparing search index...

    Variable tauriConst

    tauri: <S extends State, Store extends StoreApi<S>>(
        id: string,
        store: Store,
        options?: TauriPluginZustandStoreOptions<S>,
    ) => TauriStore<S, Store> = createTauriStore

    This is an alias for createTauriStore.

    Type declaration

      • <S extends State, Store extends StoreApi<S>>(
            id: string,
            store: Store,
            options?: TauriPluginZustandStoreOptions<S>,
        ): TauriStore<S, Store>
      • Create a new store with the given id and initial state.

        Type Parameters

        • S extends State
        • Store extends StoreApi<S>

        Parameters

        Returns TauriStore<S, Store>

        import { create } from 'zustand';
        import { createTauriStore } from '@tauri-store/zustand';

        type State = {
        counter: number;
        };

        type Action = {
        increase: () => void;
        };

        const useCounterStore = create<Action & State>((set) => ({
        counter: 0,
        increase: () => set((state) => ({ counter: state.counter + 1 })),
        }))

        const tauriHandler = createTauriStore('counter-store', useCounterStore);