• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

Share Payload between modules

Scheduled Pinned Locked Moved General Discussion
4 Posts 3 Posters 293 Views 3 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    mumblebaj Module Developer
    last edited by Aug 9, 2023, 2:17 PM

    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

    Check out my modules at: https://github.com/mumblebaj?tab=repositories

    M S 2 Replies Last reply Aug 9, 2023, 7:24 PM Reply Quote 0
    • M Offline
      MMRIZE @mumblebaj
      last edited by Aug 9, 2023, 7:24 PM

      Use sendNotification() in socketNotificationReceived() of one module to deliver payload from its nodeHelper to another module.

      1 Reply Last reply Reply Quote 0
      • S Away
        sdetweil @mumblebaj
        last edited by Aug 9, 2023, 7:44 PM

        @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.

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        M 1 Reply Last reply Aug 9, 2023, 8:11 PM Reply Quote 0
        • M Offline
          mumblebaj Module Developer @sdetweil
          last edited by Aug 9, 2023, 8:11 PM

          Thanks @sdetweil and @MMRIZE , that worked a charm. :-)

          Check out my modules at: https://github.com/mumblebaj?tab=repositories

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          1 / 1
          • First post
            1/4
            Last post
          Enjoying MagicMirror? Please consider a donation!
          MagicMirror created by Michael Teeuw.
          Forum managed by Sam, technical setup by Karsten.
          This forum is using NodeBB as its core | Contributors
          Contact | Privacy Policy