I am subscribing to an Observable in the DOM using the async pipe like so:
<div *ngIf="item$ | async as item; else loading">
....
<div>{{item.name}}</div>
</div>
All is working fine.
However, I have a refresh method that the user can call and it will make the network request again, and return the item$ observable again.
So, in my ts controller:
this.item$ = this._itemService.getItem(url);
The item is mapped in the service.
But, I am setting item$ again. So while loading, the item in the DOM disappears as it does not exist anymore, and then will come back once the new $item is retrieved.
How do I "refresh" the $item without having item disappear in the DOM?