4 lines
150 B
JavaScript
4 lines
150 B
JavaScript
|
export const filterPromises = (arr, filter) =>
|
||
|
Promise.all(arr.map(entry => filter(entry)))
|
||
|
.then(bits => arr.filter(entry => bits.shift()));
|