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


TypeScript all.all函數代碼示例

本文整理匯總了TypeScript中dojo/promise/all.all函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript all函數的具體用法?TypeScript all怎麽用?TypeScript all使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了all函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: function

    query: function (query, options) {
        var results = all([
            this.refreshResources(query),
            this.refreshAccountPermissions(query)
        ]).then(lang.hitch(this, function (response) {
            var accountPermissions = {};
            arrayUtil.forEach(response[1], function (item, idx) {
                accountPermissions[item.PermissionName] = item;
            }, this);

            var data = [];
            arrayUtil.forEach(response[0], function (item, idx) {
                var accountPermission = accountPermissions[item.name];
                data.push(lang.mixin(item, {
                    __hpcc_type: "Resources",
                    __hpcc_id: this.parentRow.__hpcc_id + CONCAT_SYMBOL + item.name,
                    __hpcc_parent: this.parentRow,
                    DisplayName: item.description ? item.description : item.name,
                    AccountName: this.groupname,
                    allow_access: accountPermission ? accountPermission.allow_access : false,
                    allow_read: accountPermission ? accountPermission.allow_read : false,
                    allow_write: accountPermission ? accountPermission.allow_write : false,
                    allow_full: accountPermission ? accountPermission.allow_full : false,
                    deny_access: accountPermission ? accountPermission.deny_access : false,
                    deny_read: accountPermission ? accountPermission.deny_read : false,
                    deny_write: accountPermission ? accountPermission.deny_write : false,
                    deny_full: accountPermission ? accountPermission.deny_full : false
                }));
            }, this);
            options = options || {};
            this.setData(SimpleQueryEngine({}, { sort: options.sort })(data));
            return this.data;
        }));
        return QueryResults(results);
    },
開發者ID:GordonSmith,項目名稱:HPCC-Platform,代碼行數:35,代碼來源:ws_access.ts

示例2: function

 this.fetchResults(function (results) {
     var resultContents = [];
     arrayUtil.forEach(resultNames, function (item, idx) {
         resultContents.push(context.namedResults[item].fetchContent(row, count));
     });
     all(resultContents).then(function (resultContents) {
         var results = [];
         arrayUtil.forEach(resultContents, function (item, idx) {
             results[resultNames[idx]] = item;
         });
         deferred.resolve(results);
     });
 });
開發者ID:Michael-Gardner,項目名稱:HPCC-Platform,代碼行數:13,代碼來源:ESPWorkunit.ts

示例3: WUQuerysetAliasAction

export function WUQuerysetAliasAction(selection, action) {
    var requests = [];
    arrayUtil.forEach(selection, function (item, idx) {
        var request = {
            QuerySetName: item.QuerySetId,
            Action: action,
            "Aliases.QuerySetAliasActionItem.0.Name": item.Name,
            "Aliases.QuerySetAliasActionItem.itemcount": 1
        };
        requests.push(ESPRequest.send("WsWorkunits", "WUQuerysetAliasAction", {
            request: request
        }));
    });
    return all(requests);
}
開發者ID:GordonSmith,項目名稱:HPCC-Platform,代碼行數:15,代碼來源:WsWorkunits.ts

示例4: WUQuerysetQueryAction

export function WUQuerysetQueryAction(selection, action) {
    if (action === "Deactivate") {
        return this.WUQuerysetAliasAction(selection, action);
    }
    var requests = [];
    arrayUtil.forEach(selection, function (item, idx) {
        var request = {
            QuerySetName: item.QuerySetId,
            Action: action,
            "Queries.QuerySetQueryActionItem.0.QueryId": item.Id,
            "Queries.QuerySetQueryActionItem.itemcount": 1
        };
        requests.push(ESPRequest.send("WsWorkunits", "WUQuerysetQueryAction", {
            request: request
        }));
    });
    return all(requests);
}
開發者ID:GordonSmith,項目名稱:HPCC-Platform,代碼行數:18,代碼來源:WsWorkunits.ts

示例5: function

    refresh: function (callback) {
        this.clear();
        this.rootItem = createTreeItem(TopologyRoot, "root");

        var context = this;
        return all({
            targetClusterQuery: WsTopology.TpTargetClusterQuery({
                request: {
                    Type: "ROOT"
                }
            }).then(function (response) {
                var clusterTypes = {};
                var retVal = [];
                if (lang.exists("TpTargetClusterQueryResponse.TpTargetClusters", response)) {
                    arrayUtil.forEach(response.TpTargetClusterQueryResponse.TpTargetClusters.TpTargetCluster, function (item, idx) {
                        if (!clusterTypes[item.Type]) {
                            clusterTypes[item.Type] = createTreeItem(TargetClusterType, item.Type, context.rootItem, { Name: item.Type })
                            retVal.push(clusterTypes[item.Type]);
                        }
                        clusterTypes[item.Type].appendChild(createTreeItem(TargetCluster, item.Name, context.rootItem, item));
                    }, this);
                }
                return retVal;
            }),
            serviceQuery: WsTopology.TpServiceQuery({
                request: {
                    Type: "ALLSERVICES"
                }
            }).then(function (response) {
                var retVal = [];
                if (lang.exists("TpServiceQueryResponse.ServiceList", response)) {
                    retVal.push(createTreeItem(Services, "Services", context.rootItem, response.TpServiceQueryResponse.ServiceList));
                }
                return retVal;
            })
        }).then(function (responses) {
            context.rootItem.appendChildren(responses.targetClusterQuery);
            context.rootItem.appendChildren(responses.serviceQuery);
            callback();
        });
    }
開發者ID:AttilaVamos,項目名稱:HPCC-Platform,代碼行數:41,代碼來源:ESPTopology.ts

示例6: function

	'custom Content-Type': function () {
		var def = this.async(),
			expectedContentType = 'application/x-test-xhr';

		function post(headers) {
			return xhr.post('/__services/request/xhr', {
				query: {
					'header-test': 'true'
				},
				headers: headers,
				data: 'testing',
				handleAs: 'json'
			});
		}

		all({
			lowercase: post({
				'content-type': expectedContentType
			}),
			uppercase: post({
				'CONTENT-TYPE': expectedContentType
			})
		}).then(
			def.callback(function (results) {
				assert.match(
					results.lowercase.headers['content-type'],
					/^application\/x-test-xhr(?:;.*)?$/
				);
				assert.match(
					results.uppercase.headers['content-type'],
					/^application\/x-test-xhr(?:;.*)?$/
				);
			}),
			def.reject
		);
	},
開發者ID:dasa,項目名稱:typings,代碼行數:36,代碼來源:xhr.ts


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