//>>built
define("dojox/mvc/StoreRefController",["dojo/_base/declare","dojo/_base/lang","dojo/when","./getStateful","./ModelRefController"],function(l,g,h,k,m){return l("dojox.mvc.StoreRefController",m,{store:null,getStatefulOptions:null,_refSourceModelProp:"model",queryStore:function(b,c){if((this.store||{}).query){this._queryObserveHandle&&this._queryObserveHandle.cancel();var d=this,a=this.store.query(b,c),e=h(a,function(a){if(!d._beingDestroyed)return a=k(a,d.getStatefulOptions),d.set(d._refSourceModelProp,
a),a});e.then&&(e=g.delegate(e));for(var f in a)isNaN(f)&&a.hasOwnProperty(f)&&g.isFunction(a[f])&&(e[f]=a[f]);return e}},getStore:function(b,c){if((this.store||{}).get){this._queryObserveHandle&&this._queryObserveHandle.cancel();var d=this;return result=h(this.store.get(b,c),function(a){if(!d._beingDestroyed)return a=k(a,d.getStatefulOptions),d.set(d._refSourceModelProp,a),a})}},putStore:function(b,c){if((this.store||{}).put)return this.store.put(b,c)},addStore:function(b,c){if((this.store||{}).add)return this.store.add(b,
c)},removeStore:function(b,c){if((this.store||{}).remove)return this.store.remove(b,c)}})});