Looking to filter an array, but it requires calling the database which returns a promise. Here's the code:
this.arrayToFilter.filter(myObject => {
this.dataBaseService.getSomething(myObject.id).then(something => {
// performing some calculations
return shouldBeFiltered
})
})
What is the best way to access the value of shouldBeFiltered
within the filter callback?