#Getting hierarchical structure subscribe
22 messages · Page 1 of 1 (latest)
mergemap ?
Probably easier to understand if you don't censor all those variables.
Why is this.appService.getMBP inside of L_______.map((data:any) => { ?
getmbp is api call globally
mergeMap don't do what i want
i want when my getM is finish
set getMBP(value of getM)
in getMBP i loop over getM value
and when it's ALL finish load other function
to be clearer
mainobject :
id
data1
data2
data3
subobject: [object1-> id,data1,data2,data3,
object2-> id,data1,data2,data3,,
object3-> id,data1,data2,data3,]
this is what i want
each object has request api based on the id of parent
i want main object calling request finish
to get is id to call subobject by request
up ?
I still think u need mergeMap. Probably want to reshare with something that makes a bit more sense.
mergeMap make my subscribe executed twice
up
for console.logs you should use tap instead of map
map needs a return value otherwise the values are lost