AngularTS
    Preparing search index...

    Interface RestCacheStore

    Async cache store used by CachedRestBackend.

    The interface is deliberately small so implementations can be backed by IndexedDB, the browser Cache API, local storage, memory, or test fixtures.

    interface RestCacheStore {
        delete(key: string): Promise<void>;
        deletePrefix(prefix: string): Promise<void>;
        get<T>(key: string): Promise<RestResponse<T> | undefined>;
        set<T>(key: string, response: RestResponse<T>): Promise<void>;
    }
    Index

    Methods

    • Delete one cached REST response.

      Parameters

      • key: string

        Exact cache key to remove.

      Returns Promise<void>

    • Delete cached REST responses whose keys start with the prefix.

      CachedRestBackend uses prefixes such as GET /api/users to invalidate collection and entity entries after successful writes.

      Parameters

      • prefix: string

      Returns Promise<void>

    • Read a cached REST response by deterministic key.

      Type Parameters

      • T

      Parameters

      Returns Promise<RestResponse<T> | undefined>

    • Store a REST response by deterministic key.

      Type Parameters

      • T

      Parameters

      Returns Promise<void>