datasource-cache.js revision 65b755664437543e907b9557027a4a608cc84c31
0N/A * Extends DataSource with caching functionality. 0N/A * @module datasource 0N/A * @submodule datasource-cache 0N/A * Adds cacheability to the YUI DataSource utility. 0N/A * @class DataSourceCache 0N/A * The namespace for the plugin. This will be the property on the host which 0N/A * references the plugin instance. 0N/A * @value "DataSourceCache" 0N/A ///////////////////////////////////////////////////////////////////////////// 0N/A // DataSourceCache Attributes 0N/A ///////////////////////////////////////////////////////////////////////////// 0N/A * Internal init() handler. 0N/A * @method initializer 0N/A * @param config {Object} Config object. 0N/A * First look for cached response, then send request to live data. 0N/A * @method _beforeDefRequestFn 0N/A * @param e {Event.Facade} Event Facade with the following properties: 0N/A * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd> 0N/A * <dt>request (Object)</dt> <dd>The request.</dd> 0N/A * <dt>callback (Object)</dt> <dd>The callback object.</dd> 0N/A * <dt>cfg (Object)</dt> <dd>Configuration object.</dd> 0N/A // Is response already in the Cache? 0N/A return new Y.
Do.
Halt(
"DataSourceCache plugin halted _defRequestFn");
0N/A * Adds data to cache before returning data. 0N/A * @method _beforeDefResponseFn 0N/A * @param e {Event.Facade} Event Facade with the following properties: 0N/A * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd> 0N/A * <dt>request (Object)</dt> <dd>The request.</dd> 0N/A * <dt>callback (Object)</dt> <dd>The callback object with the following properties: 0N/A * <dt>success (Function)</dt> <dd>Success handler.</dd> 0N/A * <dt>failure (Function)</dt> <dd>Failure handler.</dd> 0N/A * <dt>scope (Object)</dt> <dd>Execution context.</dd> 0N/A * <dt>data (Object)</dt> <dd>Raw data.</dd> 0N/A * <dt>response (Object)</dt> <dd>Normalized resopnse object with the following properties: 0N/A * <dt>results (Object)</dt> <dd>Parsed results.</dd> 0N/A * <dt>meta (Object)</dt> <dd>Parsed meta data.</dd> 0N/A * <dt>error (Object)</dt> <dd>Error object.</dd> 1204N/A * <dt>cfg (Object)</dt> <dd>Configuration object.</dd> 0N/A // Add to Cache before returning 0N/A},
'@VERSION@' ,{
requires:[
'datasource-local',
'cache']});