ServiceCacheMixin Class
A Mixin class for caching JSON API resource objects
Item Index
Methods
Properties
Methods
cacheControl
(
-
resource -
headers
Store meta from headers on resource meta, window.fetch includes
a headers object in the response use headers.get to lookup data
from the headers for cache-control, date, and etag.
Parameters:
-
resourceResource -
headersObject
cacheData
(
-
resp
Store resource objects in the data array of the cache
Parameters:
-
respObjectw/ props: {Object} meta, {Array|Object} data, & {Object} headers
cacheLookup
(
Resource | Undefined
-
id
Lookup a resource from cached data
Parameters:
-
idString
Returns:
Resource | Undefined:
cacheMeta
(
-
resp
Store meta data in the cache
Parameters:
-
respObjectw/ props: {Object} meta, {Array|Object} data, & {Object} headers
cacheResource
(
-
resp
Store response object(s) in the cache
Parameters:
-
respObjectw/ props: {Object} meta, {Array|Object} data, & {Object} headers
cacheUpdate
(
-
resp
Add or update cache data
Parameters:
-
respObjectw/ props: {Object} meta, {Array|Object} data, & {Object} headers
initCache
()
Initialize a cache object
Properties
cache
Object
Cache object
