Utilizing Firebase's real-time database, I am updating values in a chart as they change. However, my struggle lies in retrieving only the most recent value added to the database.
While browsing through limitToLast and 'child_added' do not work together #1773, I attempted to implement some suggestions but couldn't get it to function properly.
Currently, this is what I have managed to achieve:
this.items = db.list('/items').valueChanges()
this.items.forEach(item => {
this.data = item;
this.add(this.data[this.data.length-1])
console.log(this.data)
})
add(point: any) {
this.chart.addPoint(point)
}
Realistically, I am aware that this approach is far from efficient.