@mica/sdk (SDK contract v1)
    Preparing search index...

    Interface PersistedOptions<T>

    Options for one usePersisted store.

    interface PersistedOptions<T> {
        sanitize?: (value: unknown) => T;
        sync?: boolean;
    }

    Type Parameters

    • T
    Index
    sanitize?: (value: unknown) => T

    Repair or reject a value before it is stored or handed out.

    Runs on the value read at startup and on every write, so a store cannot be talked into holding something the app would refuse. Stored data outlives the code that wrote it.

    sync?: boolean

    Whether the value syncs to the server. Defaults to true.