title: Create a singleton for a Redux Store without attaching to window
body: <p>I'm looking for a way to import a created store in a node module, into other node modules. With the following few constraints I want to apply:</p>
  
  <ul>
  <li>It should be a singleton, every time I import it should (of course :) ) be the same store</li>
  <li>Avoid attaching to global 'window' object.</li>
  <li>Write in ES6, build with webpack.</li>
  <li>Modules import the store when a module requires it.</li>
  </ul>
  
  <p>I have investigated a lot, but not come across a solution that matches the above.</p>
  
  <p>So far I have this:</p>
  
  <p>global_store:</p>
  
  <pre><code>import { setupStore } from './store';
  
  const globalStore = setupStore({});
  
  module.exports = globalStore;
  </code></pre>
  
  <p>Module A:</p>
  
  <pre><code>import globalStore from 'global_store';
  import {
    ACTION_A
  } from 'actions';
  
  globalStore.dispatch({
    type: ACTION_A,
    payload: {
      item: 'item1',
    },
  });
  </code></pre>
  
  <p>Module B:</p>
  
  <pre><code>import globalStore from 'global_store';
  import {
    ACTION_B
  } from 'actions';
  
  globalStore.dispatch({
    type: ACTION_B,
    payload: {
      item: 'item2',
    },
  });
  </code></pre>
  
  <p>The result is unfortunately that both modules create their own store. Is there something possible to use a shared store in a similar construction?</p>