Read the statement by Michael Teeuw here.
Share Payload between modules
-
Hi Guys,
Is there a way to share the payload between modules? I.e. have one module do a GET request and then share the payload it receives with another module? As I understand it, the sendSocketNotification is only valid within it’s own scope/module and cannot be intercepted by another module. At least this was what I understood from another post I read a while back.
I have two modules and they both run off the same payload and would like to share this between the two rather than make two calls.
If this is possible, please advise how.
Thanks
-
Use
sendNotification()
insocketNotificationReceived()
of one module to deliver payload from its nodeHelper to another module. -
@mumblebaj you would have to send it up to your modulename.js, which can then broadcast it to the other modules using sendNotification()/notificationReceived(). socketnotifications are only between the modulename.js and the modules node_helper.
-