datasource-cache-min.js revision 9e58396d3563168e91dc995170288bc18b84ab6f
YUI.add("datasource-cache",function(C){var B=C.DataSource,A=function(){};A.ATTRS={cache:{value:null,validator:function(D){return((D instanceof C.Cache)||(D===null));},set:function(D){this.on("request",this._beforeRequest);this.on("response",this._beforeResponse);}}};A.prototype={_beforeRequest:function(E,F){var D=(this.get("cache")&&this.get("cache").retrieve(F.request,F.callback))||null;if(D&&D.response){E.stopImmediatePropagation();this.fire("response",null,C.mix(F,D.response));}},_beforeResponse:function(D,E){if(this.get("cache")){this.get("cache").add(E.request,E,(E.callback&&E.callback.argument));}}};C.Base.build(B,[A],{dynamic:false});},"@VERSION@",{requires:["datasource-base"]});