Package org.angular.ts.ng
Interface RestCacheStore
@JsType(isNative=true,
name="ng.RestCacheStore",
namespace="<global>")
public 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.-
Method Summary
Modifier and TypeMethodDescriptionelemental2.promise.Promise<Void> Delete one cached REST response.elemental2.promise.Promise<Void> deletePrefix(String prefix) Delete cached REST responses whose keys start with the prefix.<T> elemental2.promise.Promise<RestResponse<T>> Read a cached REST response by deterministic key.<T> elemental2.promise.Promise<Void> set(String key, RestResponse<T> response) Store a REST response by deterministic key.
-
Method Details
-
delete
Delete one cached REST response.- Parameters:
key- Exact cache key to remove.- Returns:
- Method result.
-
deletePrefix
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- Value supplied for the prefix parameter.- Returns:
- Method result.
-
get
Read a cached REST response by deterministic key.- Parameters:
key- Opaque cache key supplied byCachedRestBackend.- Returns:
- Method result.
-
set
Store a REST response by deterministic key.- Parameters:
key- Opaque cache key supplied byCachedRestBackend.response- Response to persist.- Returns:
- Method result.
-