I have filtered list:
public filteredEvents$ = new BehaviorSubject([]);
And method that inverts propery checked_export
and pushed changes back:
public checkAll(): void {
this.filteredEvents$
.pipe(
map((events: IEvent[]) => {
return events.map((event: IEvent) => {
event.checked_export = !event.checked_export;
return event;
});
})
)
.subscribe((events) => this.filteredEvents$.next(events));
}
Template is:
<div *ngFor="let item of filteredEvents$ | async">
Obviously I get error:
ERROR RangeError: Maximum call stack size exceeded
I can push chnages to this.selectedEvents$
like:
public checkAll(): void {
this.filteredEvents$
.pipe(
map((events: IEvent[]) => {
return events.map((event: IEvent) => {
event.checked_export = !event.checked_export;
return event;
});
})
)
.subscribe((events) => this.selectedEvents$.next(events));
}
But it calls always this line:
public export(): void {
this.eventService.selectedEvents$
.pipe().subscribe((fileid) => {});
}
My problem is to modify current this.filteredEvents$
question from:
https://stackoverflow.com/questions/65623050/how-to-avoid-maximum-call-stack-size-exceeded-in-observable 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…