Type Alias: FetchStrategyCacheConfig
FetchStrategyCacheConfig =
object
Defined in: packages/core/src/types.ts:90
Properties
afterGet()?
optionalafterGet: <E,P,R>(options,data) =>Promise<FetchResponse<R>>
Defined in: packages/core/src/types.ts:129
If set, this function will be executed after restoring data from cache (cache.get) and can be used to reconstruct things that were removed in beforeSet.
Type Parameters
E
E
P
P extends EndpointParams
R
R
Parameters
options
FetchStrategyCacheHandlerOptions<E, P, R>
data
Returns
Promise<FetchResponse<R>>
beforeSet()?
optionalbeforeSet: <E,P,R>(options,data) =>Promise<FetchResponse<R>>
Defined in: packages/core/src/types.ts:117
If set, this function will be executed before calling the cache.set method It's useful if you want to remove things from the data before caching.
Type Parameters
E
E
P
P extends EndpointParams
R
R
Parameters
options
FetchStrategyCacheHandlerOptions<E, P, R>
data
Returns
Promise<FetchResponse<R>>
cacheHandler?
optionalcacheHandler:FetchStrategyCacheHandler
Defined in: packages/core/src/types.ts:139
A custom cache handler implementation
If set will override the default in-memory cache handler
enabled?
optionalenabled:boolean| <E,P,R>(options) =>boolean
Defined in: packages/core/src/types.ts:103
Whether the cache should be enable globably or for a given fetchStrategy
ttl?
optionalttl:number| <E,P,R>(options) =>number
Defined in: packages/core/src/types.ts:94
TTL in seconds