define([
        "dojo/_base/declare",
        "dijit/_WidgetBase", 
        "dojo/json",
        "dojo/request/xhr"        
        ], function(declare,_WidgetBase, json,xhr){
	return declare("chy.store.intakeStore",[_WidgetBase], {
		url:"",
		data: {},
		callback:function(){},
		
		constructor: function(args){
            declare.safeMixin(this,args);
			this.getData();
		},
		
		getData: function(){
			var _this=this;
        	var result = xhr(this.url, {
				url: this.url,
				handleAs: "json",
				error: function(error){
					console.error("Cthulhu",error);
				}
			}).then(function(data){
				_this.data=data;
				_this.callback();
				return data;
			});
			
		}
	});
});