React Native Storage - v2.0.0
    Preparing search index...

    Interface AsyncStorageDriver

    interface AsyncStorageDriver {
        name: string;
        maxValueBytes?: number;
        subscribe?(listener: (key: string | null) => void): () => void;
        sync: false;
        getItem(key: string): string | Promise<string | null> | null;
        setItem(key: string, value: string): void | Promise<void>;
        removeItem(key: string): void | Promise<void>;
        getAllKeys?(): readonly string[] | Promise<readonly string[]>;
    }

    Hierarchy

    • DriverBase
      • AsyncStorageDriver
    Index
    name: string

    Human-readable name used in error messages, for example "mmkv".

    maxValueBytes?: number

    The largest value, in UTF-8 bytes, this backend stores reliably. The storage uses the smaller of this and its own maxValueBytes.

    sync: false
    • Calls listener with the full key when a value changes outside this storage, for example through the same MMKV instance or in another browser tab; null means every key may have changed. Returns a function that stops listening.

      Parameters

      • listener: (key: string | null) => void

      Returns () => void

    • Parameters

      • key: string

      Returns string | Promise<string | null> | null

    • Parameters

      • key: string
      • value: string

      Returns void | Promise<void>

    • Parameters

      • key: string

      Returns void | Promise<void>

    • Returns readonly string[] | Promise<readonly string[]>