#Getting hierarchical structure subscribe

22 messages · Page 1 of 1 (latest)

strange coyote
#

You want to use mergeMap instead of map when calling getMBP, but what's that L._____.map?

rugged slate
#

mergemap ?

strange coyote
#

Probably easier to understand if you don't censor all those variables.

#

Why is this.appService.getMBP inside of L_______.map((data:any) => { ?

rugged slate
#

getmbp is api call globally

rugged slate
#

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

rugged slate
#

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

rugged slate
#

up ?

strange coyote
#

I still think u need mergeMap. Probably want to reshare with something that makes a bit more sense.

rugged slate
#

mergeMap make my subscribe executed twice

rugged slate
#

it's hurt my brain actually

#

it's look like over engineered for nothing

rugged slate
#

up

fathom pollen
#

for console.logs you should use tap instead of map

rugged slate
#

why

#

i don't really care of console.log i just want my main object full

fathom pollen
#

map needs a return value otherwise the values are lost