Is there any option to get two values from one subscription? The first being all profile data and the second is just the favorite data filtering by name. I want to use fewest number of firebase request as I can.
the db structure:
profile{
uid{
name,
age,
favorite{
name,
uid,
}
}
}
this the component code:
ngOnInit() {
this.db.getDataObj("/Profile/" + this.uid).subscribe(res =>{
console.log("Profile Result");
console.log(res);
});
this.db.getDataObj("/Profile/" + this.uid/favorite).subscribe(res =>{
console.log("Profile Result");
console.log(res);
});
this the service code:
getDataObj(objpath:string){
this.objRef = this.db.object(objpath);
this.obj = this.objRef.valueChanges();
return this.obj;
}
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)