When working with a table containing a list of objects and offering users the option to edit these objects, I find myself questioning whether to utilize the API in the parent component (object list), the child component (individual object), or both. Is it possible to streamline this process by replacing two API calls with just one observer using RxJS in the parent component and passing data via @Input to the child component? Would this be a practical and efficient approach?
ParentList(){
listObjects$: Observable<Object[]>;
this.listObjects$.pipe(take(1)).subscribe(list => {
//Assign listObjects
});
}
ChildForm(){
@Input() object$!: Observable<Object>;
}
I attempted to make separate API service calls for each instance.