phpldapadmin/application/media/js/dojo-release-1.7.2/dojox/lang/async/topic.js

38 lines
568 B
JavaScript
Raw Normal View History

2012-06-19 02:07:43 +00:00
//>>built
define(["dijit","dojo","dojox"],function(_1,_2,_3){
_2.provide("dojox.lang.async.topic");
(function(){
var d=_2,_4=_3.lang.async.topic;
_4.from=function(_5){
return function(){
var h,_6=function(){
if(h){
d.unsubscribe(h);
h=null;
}
},x=new d.Deferred(_6);
h=d.subscribe(_5,function(){
_6();
x.callback(arguments);
});
return x;
};
};
_4.failOn=function(_7){
return function(){
var h,_8=function(){
if(h){
d.unsubscribe(h);
h=null;
}
},x=new d.Deferred(_8);
h=d.subscribe(_7,function(_9){
_8();
x.errback(new Error(arguments));
});
return x;
};
};
})();
});