In angular, we use HttpClient to make HTTP calls which return an observable, if we wanna use promises we can use lastValueFrom/firstValueFrom.
Let's say we have:
async getLast() {
const get$ = this.http.get(url);
const res1 = await lastValueFrom(get$);
}
async getFirst() {
const get$ = this.http.get(url);
const res2 = await firstValueFrom(get$);
}
are res1 and res2 always equivalent? what is the correct version to use?