本文整理匯總了TypeScript中dojo/topic.publish函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript publish函數的具體用法?TypeScript publish怎麽用?TypeScript publish使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了publish函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
.then((data)=>{
if(!data.state || data.state != stateCode.SUCCESS || !data.user) {
topic.publish('login/error', data.info);
} else {
topic.publish('login/error', lang.xhrRegSuccess);
}
}, (error)=>{
示例2: if
.then((data)=>{
if(data.state === stateCode.SUCCESS && dojo.isArray(data.financePreviewData)) {
this.dataHandler(data.financePreviewData);
topic.publish('finance/financeDataChanged', false);
} else if(data.state === stateCode.Error) {
topic.publish('tipService/warning', data.info);
} else if(data.state === stateCode.NOTLOGGIN) {
topic.publish('tipService/warning', data.info);
user.logout();
} else {
topic.publish('tipService/warning', lang.xhrDataError);
}
}, (error)=>{
示例3: setStore
setStore(data) {
if(dojo.isArray(data.accountBooks) && dojo.isArray(data.accounts)) {
this.store = data.accountBooks;
this.accountStore = data.accounts;
topic.publish('financeapp/accountBookData', this);
}
}
示例4: function
_hasCompletedSetter: function (completed) {
var justCompleted = !this.hasCompleted && completed;
this.hasCompleted = completed;
if (justCompleted) {
topic.publish("hpcc/ecl_wu_completed", this);
}
},
示例5: onFetchGraphXgmml
}).then(function (response) {
if (lang.exists("WUGetGraphResponse.Graphs.ECLGraphEx", response) && response.WUGetGraphResponse.Graphs.ECLGraphEx.length) {
if (subGraphId) {
if (!context.subgraphs) {
context.subgraphs = {};
}
if (!context.subgraphs[idx + "." + subGraphId]) {
context.subgraphs[idx + "." + subGraphId] = {};
}
context.subgraphs[idx + "." + subGraphId].xgmml = "<graph>" + response.WUGetGraphResponse.Graphs.ECLGraphEx[0].Graph + "</graph>";
onFetchGraphXgmml(context.subgraphs[idx + "." + subGraphId].xgmml, context.subgraphs[idx + "." + subGraphId].svg);
} else {
context.graphs[idx].xgmml = response.WUGetGraphResponse.Graphs.ECLGraphEx[0].Graph;
onFetchGraphXgmml(context.graphs[idx].xgmml, context.graphs[idx].svg);
}
} else {
topic.publish("hpcc/brToaster", {
Severity: "Error",
Source: "ESPWorkunit.fetchGraphXgmml",
Exceptions: [
{ Message: context.i18n.FetchingXGMMLFailed }
]
});
onFetchGraphXgmml("", "");
}
});
示例6: function
this.topicHandler.push(topic.subscribe('validateCode/validate', function(callback) {
let validate = captchaObj.getValidate();
if (!validate) {
topic.publish('tipService/warning', lang.validateWarning);
return;
}
let option: any = {
handleAs: 'json',
data: {
geetest_challenge: validate.geetest_challenge,
geetest_validate: validate.geetest_validate,
geetest_seccode: validate.geetest_seccode
}
};
xhr.post(`${Config.requestHost}/validateCapthca`, option)
.then((data)=>{
if(!data.state || data.state != stateCode.SUCCESS) {
topic.publish('tipService/warning', data.info);
} else {
callback();
}
}, (error)=>{
});
}));