Most of the popular Angular state management libraries like NgRx expose application state in a form of a stream of state objects. This is usually implemented with the help of RxJS Observables.
The state updates get pushed to the components which react by re-rendering their templates to display the most recent version of the application state.
There are multiple ways in which it is possible to consume this observable stream of state updates by the components, the two most popular being:
subscribe()method and storing the state on the component instance,
todos$.subscribe(todos => this.todos = todos)...
The | async pipe unwraps the state object directly in the component’s template,
<li *ngFor=”let todo of todos$ | async”></li>...
I have been thinking about this question and related trade-offs for quite some time now. I was mostly in favor of using subscribe() but couldn’t really point out exact reasons why.