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