本文整理汇总了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);
},
示例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);
});
});
示例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);
}
示例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);
}
示例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();
});
}
示例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
);
},