quetch / cache
cache<
I
,O
,In
,On
>(__namedParameters
):Handler
<I
,O
,In
,On
>
• I extends Query
<any
> & object
• O
• In extends Query
<any
>
• On
(query
, cachedQuery
) => undefined
| I
Returns a query that completes the cached value.
Returns undefined
if the query should not be completed.
(query
, cachedQuery
, cachedValue
) => boolean
Returns true
if the cached item must be invalidated.
(query
) => undefined
| string
= ...
Unique identifier for the item to cache.
Returns undefined
if the item should not be cached.
(value
, cachedValue
, query
, cachedQuery
) => any
Merges the value from the extended query with the cached value.
Only called when extendCachedQuery
returns a query.
(extendedQuery
, cachedQuery
) => I
Merges the extended query with the cached query.
Only called when extendCachedQuery
returns a query.
Store
<CachedItem
<I
>>
Cache store.
Handler
<I
, O
, In
, On
>