當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript topic.publish函數代碼示例

本文整理匯總了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)=>{
開發者ID:qinqin65,項目名稱:QuickFinance,代碼行數:7,代碼來源:user.ts

示例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)=>{
開發者ID:qinqin65,項目名稱:QuickFinance,代碼行數:13,代碼來源:store.ts

示例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);
     }
 }
開發者ID:qinqin65,項目名稱:QuickFinance,代碼行數:7,代碼來源:store.ts

示例4: function

 _hasCompletedSetter: function (completed) {
     var justCompleted = !this.hasCompleted && completed;
     this.hasCompleted = completed;
     if (justCompleted) {
         topic.publish("hpcc/ecl_wu_completed", this);
     }
 },
開發者ID:Michael-Gardner,項目名稱:HPCC-Platform,代碼行數:7,代碼來源:ESPWorkunit.ts

示例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("", "");
     }
 });
開發者ID:Michael-Gardner,項目名稱:HPCC-Platform,代碼行數:26,代碼來源:ESPWorkunit.ts

示例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)=>{

            });
        }));
開發者ID:qinqin65,項目名稱:QuickFinance,代碼行數:25,代碼來源:validateCode.ts


注:本文中的dojo/topic.publish函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。