Is there a way to compare the length of the array returned after an API refresh call with the previous value?
For instance:
let currentLength;
let previousLength;
ngOnInit() {
this.dataService.getData().subscribe(data => {
this.data = data;
this.currentLength = this.data.length;
// Add logic here to compare currentLength with previousLength
})
this.dataService.getUpdatedData().subscribe();
}