After subscribing to valueChanges, I initially receive an object of length 1, as shown in the console.log (image below), and shortly after that the object with all values. However, this is not what I need. I require getting all values from the start so that I can continue working with them. Can anyone offer assistance? Thank you.
return new Promise(resolve => {
this.store.collection('Kontaktdaten',ref => ref.where('Ankunft', '>=', timeAnkunft))
.valueChanges()
.subscribe((persons) => {
personsArray = persons;
console.log(personsArray)
personsArray.map((person,index,array) => {
if(person.Ende > timeEndeBesuch) {
array.splice(index,1);
}
})
resolve(personsArray);
})
})