Read the statement by Michael Teeuw here.
Connecting Modules to Each Other
-
@tonkxy should be able to save the payload pointer and then use that day later. I do it all the time
this.weatherInfo = payload
for example
remember your module could get called at getDom() long before the other module sends the notification, so u need to check if it has arrived yet.
-
@sdetweil funny you say that. Ive been reading and you offered the solution on someone using compliments + weather. My issue is when i step through to set image, the type is back to undefined and not carried from the notification. Im wondering if its in my order as to why its going back to undefined
-
@tonkxy I would put a stop everywhere u set it.
make sure the this. pointer is pointing to the same place set vs use
-
@sdetweil when you say stop you mean in my debug to see where im losing the value?
-
@tonkxy correct
-
@sdetweil Great advice.
I stepped through and you were right on two things. When it starts, it defaults with the else case, because it hasn’t fetched the type yet. Once it does fetch the type I was resetting it in the myJob() function causing it to be undefined again.
I appreciate the break down on this. JS is definitely giving me a run for my money on learning it.
-
@tonkxy glad you are making progress.
not a JS problem. any language would have the same problem…