So I went ahead & basically copied the Dojo addOnLoad functions & added it to my class. It seems to be working. I looked at doing a pub/sub or a dojo.connect, but I feel like this was the cleanest, most recognizable solution.
Below are the necessary bits to get it going, again stripped out of dojo.js and plugged into my class:
_onto : function(arr, obj, fn){
if(!fn){
arr.push(obj);
}else if(fn){
var func = (typeof fn == "string") ? obj[fn] : fn;
arr.push(function(){ func.call(obj); });
}
},
_loaded : function() {
this._loadNotifying = true;
this._postLoad = true;
var mll = this._loaders;
for(var x = 0; x < mll.length; x++){
try{
mll[x]();
}catch(e){
throw e;
console.error("addOnLoad callback failed: " + e, e); /* let other load events fire, like the parser, but report the error */
}
}
this._loadNotifying = false;
//Make sure nothing else got added to the onload queue
//after this first run. If something did, and we are not waiting for any
//more inflight resources, run again.
if(this._postLoad && this._inFlightCount == 0 && mll.length){
this._loaded();
}
},
addOnLoad : function(/*Object?*/obj, /*String|Function?*/functionName){
this._onto(this._loaders, obj, functionName);
if(this._postLoad && !this._loadNotifying){
this._loaded();
}
}