本文整理汇总了TypeScript中Immutable.Set.forEach方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Set.forEach方法的具体用法?TypeScript Set.forEach怎么用?TypeScript Set.forEach使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Immutable.Set
的用法示例。
在下文中一共展示了Set.forEach方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
return objects.filter((object) => {
let found = false;
types.forEach((type) => {
if (object instanceof INSTANCE_TYPES[type]) {
found = true;
}
});
return found;
});
示例2: filterObject
filterObject(json: object, paths: Set<string>): object {
const result = {};
paths.forEach(path => {
const filteredObject = this.filterObjectRecursively(json, path);
if (filteredObject) {
_.merge(result, filteredObject);
}
});
this.recordCleanupService.cleanup(result);
return result;
}
示例3: populateResultsPage
private populateResultsPage(desiredPrice: number, results: Set<Set<string>>) {
// Put the extracted budget on the page
$("#budget").append(Formatter.formatCurrency(desiredPrice));
if (results.isEmpty() || results.first().isEmpty()) {
$("#preamble").append(`
<div class="alert alert-danger" id="noresults">
There is no combination of foods that satisfies your budget.
</div>
`);
} else {
// Each combo of results
results.forEach((combo) => {
$("#results").append(`<li class="list-group-item"><ul class="entry"></ul></li>`);
// Each food item within combo of results
combo.forEach((sentence) => {
$(".entry").last().append(`<li class="list-unstyled food">${sentence}</li>`);
});
});
}
}