Skip to content

Commit 140111f

Browse files
committed
Removed flatMap, added TODOs and link to GH issue
1 parent 472bc84 commit 140111f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/runtime/manifest.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export class Manifest {
174174
return [...new Set(this._findAll(manifest => manifest._recipes))];
175175
}
176176
get allHandles() {
177-
// Reduce is equivalent to flatMap
177+
// TODO(#4820) Update `reduce` to use flatMap
178178
return [...new Set(this._findAll(manifest => manifest._recipes.reduce((acc, x) => acc.concat(x.handles), [])))];
179179
}
180180
get activeRecipe() {
@@ -329,8 +329,9 @@ export class Manifest {
329329
function fatePredicate(handle: Handle) {
330330
return fates === [] || fates.includes(handle.fate);
331331
}
332+
// TODO(#4820) Update `reduce` to use flatMap
332333
return [...this._findAll(manifest => manifest._recipes
333-
.flatMap(r => r.handles)
334+
.reduce((acc, r) => acc.concat(r.handles), [])
334335
.filter(h => this._typePredicate(h, type, subtype) && tagPredicate(h) && fatePredicate(h)))];
335336
}
336337
findHandlesById(id: string): Handle[] {

0 commit comments

Comments
 (0)