Amplify JS API Documentation
    Preparing search index...

    Interface KeyValueStorageInterface

    interface KeyValueStorageInterface {
        addListener?(
            listener: (ev: KeyValueStorageEvent) => Promise<void>,
        ): () => void;
        clear(): Promise<void>;
        getItem(key: string): Promise<string | null>;
        removeItem(key: string): Promise<void>;
        setItem(key: string, value: string): Promise<void>;
    }

    Implemented by

    Index

    Methods

    • Subscribe to cross-tab storage changes.

      Parameters

      • listener: (ev: KeyValueStorageEvent) => Promise<void>

        invoked when the underlying storage changes in another tab.

      Returns () => void

      an unsubscribe function that removes the listener. Optional: storages that do not support cross-tab notifications (e.g. cookie storage) may omit it.

    • Returns Promise<void>

    • Parameters

      • key: string

      Returns Promise<string | null>

    • Parameters

      • key: string

      Returns Promise<void>

    • Parameters

      • key: string
      • value: string

      Returns Promise<void>