datasource-cache-min.js revision fde564a2cb44f0d31d9eb8e59bac8c457f7d8ca6
YUI.add("datasource-cache",function(D){var C=D.Lang,B=D.DataSource,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"]});