@tauri-apps/plugin-store - v2.3.0
    Preparing search index...

    Class LazyStore

    A lazy loaded key-value store persisted by the backend layer.

    Implements

    • IStore
    Index

    Constructors

    Methods

    • Returns the value for the given key or undefined if the key does not exist.

      Type Parameters

      • T

      Parameters

      • key: string

      Returns Promise<undefined | T>

    • Attempts to load the on-disk state at the store's path into memory.

      This method is useful if the on-disk state was edited by the user and you want to synchronize the changes.

      Note: This method does not emit change events.

      Returns Promise<void>

    • Listen to changes on a store key.

      Type Parameters

      • T

      Parameters

      • key: string
      • cb: (value: undefined | T) => void

      Returns Promise<UnlistenFn>

      A promise resolving to a function to unlisten to the event.

      2.0.0

    • Listen to changes on the store.

      Type Parameters

      • T

      Parameters

      • cb: (key: string, value: undefined | T) => void

      Returns Promise<UnlistenFn>

      A promise resolving to a function to unlisten to the event.

      2.0.0

    • Close the store and cleans up this resource from memory. You should not call any method on this object anymore and should drop any reference to it.

      Returns Promise<void>