Custom Global Events / Variable Change Listeners
I want to create custom interaction triggers / event listeners via e.g. a plugin.
My use case is that I want to be able to dispatch a custom event / set a variable on user interaction, and then listen in other parts of the prototype for this event / change to variable.
My current need is to have elements in one master (menu) interact with other masters, more specifically I wanted to have a menu item in my "menu" master dispatch an event/set a variable instead of directly manipulating the prototype (which it currently cant because the master has no knowledge of the surrounding context/parent), and then in the rest of my prototype I would be able to use the event as a trigger to show/hide layers.
Now, how is this best achieved ?