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

    Interface StoreHooks<S>

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

    interface StoreHooks<S extends State = State> {
        beforeBackendSync?: (state: S) => Option<Partial<S>>;
        beforeFrontendSync?: (state: S) => Option<Partial<S>>;
        error?: (error: unknown) => MaybePromise<void>;
    }

    Type Parameters

    Index

    Properties

    beforeBackendSync?: (state: S) => Option<Partial<S>>

    Hook that runs before the store sends its state to Rust. Can be used to modify the state before the sync.

    Returning a nullish value will abort the operation.

    beforeFrontendSync?: (state: S) => Option<Partial<S>>

    Hook that runs before the store attempts to update itself with data coming from Rust. Can be used to modify the state before the changes are applied.

    Returning a nullish value will abort the operation.

    error?: (error: unknown) => MaybePromise<void>

    Custom error handler.

    console.error