title: What is shared between multiple windows in an electron app?
body: <p>I have an electron app which works fine as a single application. I use pubsub-js to push messages from components for other bits of the UI to handle without being tightly coupled. I use an MVVM framework so I use this event system to communicate between view components without them all being linked to each other, I do use IPC events for some electron messages but generally I just use that for low level events, and pubsub for view level events for only view components to listen for.</p>
  
  <p>Now the problem seems to arise when I want to support multiple windows, as for example if I go and try to save on window 1, it seems to actually run the save on window 2, as well as notifications from window 1 ending up on window 2, so it seems to share some sort of state across applications.</p>
  
  <p>Also another problem I just noticed, if I were to create window 2 from window 1, then I were to close window 2, the native menu bar in windows 1 stops functioning and just throws exceptions.</p>
  
  <p>So what exactly gets shared between multiple electron windows and what is the best practice for isolating this sort of behaviour? </p>