In my component i'm using an @Input that is type of Observable. In the view I'm using the | async pipe to handle the subscribe and unsubscribe of the Observable stream.
In the component I'm trying to pipe this Observable to perform some mutation on the stream. However the map function inside the pipe never gets triggered.
data.component.ts:
@Component({
selector: 'data',
template: `<div *ngFor="let item of (data$ | async)">{{item}}</div>`
})
export class DataComponent implements OnInit {
@Input()
data$: Observable<IData>;
constructor() {}
ngOnInit() {
this.data$
.pipe(
map(next => {
// do some data mutation
// never getting in here
})
)
}
}
Right now the map function inside the pipe never gets triggered and thus does not mutate the data as desired. The desired outcome would be that the data mutation happens inside the map function.