abstractnew Cacheable(args)
Base class for objects that can cache their contents
Name | Type | Description |
---|---|---|
args |
Object | cacheable arguments |
Example
var cacheable = new ChildOfCacheable({
cache : variable_retrieved_from_storage,
cache_updater : function(cache) { storage.store( cache ) },
reload_interval: 60 * 60 * 1000, // optional
... // arguments to child object
});
Methods
-
abstractrefresh(args){jQuery.Promise}
-
Reload the cached values
Name Type Description args
Object cacheable arguments (as passed to Cacheable()) Returns:
Type Description jQuery.Promise promise that will return when the cache has been refreshed -
update_cache()
-
Update this.cache using the passed cache_updater() callback