tauri-store - v1.2.3
    Preparing search index...

    Class Store<S>

    A key-value store that can sync its state with the Rust backend and persist it to disk.

    Type Parameters

    Hierarchy

    • BaseStore<S>
      • Store

    Implements

    Index
    id: string

    Store id.

    • Returns the value of the given key.

      Type Parameters

      • K extends string | number | symbol

      Parameters

      • key: K

      Returns S[K]

    • Returns true if the given key exists in the store.

      Parameters

      • key: string

      Returns boolean

    • Inserts a key-value pair in the store.

      Type Parameters

      • K extends string | number | symbol

      Parameters

      • key: K
      • value: S[K]

      Returns void

    • Starts the store synchronization.

      Returns Promise<void>

    • Stops the store synchronization.

      Returns Promise<void>

    • Subscribes to changes in the store.

      Parameters

      • fn: (state: S) => void

      Returns Fn

    • Updates a value in the store using a function.

      Type Parameters

      • K extends string | number | symbol

      Parameters

      • key: K
      • fn: (value: S[K]) => S[K]

      Returns void