@adobe/data - v0.10.30
    Preparing search index...

    Interface DataCache<K, V>

    A persistent cache that stores data with an optional expiration time.

    interface DataCache<K extends Data, V extends Data> {
        delete(key: K): Promise<void>;
        match(key: K): Promise<undefined | V>;
        put(key: K, value: V, options?: { maximumDuration: number }): Promise<void>;
    }

    Type Parameters

    Index

    Methods

    Methods

    • Deletes an item from the cache.

      Parameters

      • key: K

        The key previously used to store the value.

      Returns Promise<void>

    • Attempts to retrieve a value from the cache.

      Parameters

      • key: K

        The key previously used to store the value.

      Returns Promise<undefined | V>

    • Stores a new value within the cache.

      Parameters

      • key: K

        key to use to store the value

      • value: V

        the value to store

      • Optionaloptions: { maximumDuration: number }

        optional TTL settings, relative to now

      Returns Promise<void>