SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Interface PersistenceStore

    Primary interface for storing retrieving key/value pairs

    interface PersistenceStore {
        getItem(key: string): string | null;
        onReady?(callback: () => void): void;
        removeItem(key: string): void;
        setItem(key: string, value: string): void;
        subscribe?(onExternalChange: (changedKey: string) => void): () => void;
    }

    Implemented by

    Index
    • Retrieves the value associated with the given key.

      Parameters

      • key: string

        The key to retrieve.

      Returns string | null

    • If implemented the provider will is this called when the store is ready to be used.

      Parameters

      • callback: () => void

      Returns void

      This is useful for avoiding flash with asynchronous stores that need to do some initialization before use.

      If this is implemented it should be called once when the store is ready. If the store is already ready when called it should invoke immediately the callback synchronously.

    • Removes the value associated with the given key.

      Parameters

      • key: string

        The key to remove.

      Returns void

    • Sets the value for the given key.

      Parameters

      • key: string

        The key to set.

      • value: string

        The value to associate with the key.

      Returns void

    • Subscribes to external changes for cross-tab synchronization.

      Parameters

      • onExternalChange: (changedKey: string) => void

        Callback invoked when a key changes externally.

      Returns () => void

      Not all state implementations support cross-tab subscription (may no-op)