本文整理汇总了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)=>{
});
}));