title: How to Invalidate Dojo/Require's Module Cache?
body: <p>I have a dojo-based module that automates loading a dojo/store/Memory for me, using a bang. It's called like so:</p>
  
  <pre><code>require( [ 'squad_builder/storeBroker!collectionStore' ],
      function( collectionStore )
  { 
      // use store...
  } );
  </code></pre>
  
  <p>The first require() call loads the store and subsequent ones load the store from a cache.</p>
  
  <p>This works well but I cannot figure out how to invalidate require's internal cache so I can make the next request load the store with fresh data.</p>
  
  <p>Is there anything built into require() to do this or do I need to mess with some internal workings (and if so, where?)</p>
  
  <p><strong>Edit</strong></p>
  
  <p>In <a href="http://dojotoolkit.org/reference-guide/1.9/loader/amd.html#loader-amd" rel="nofollow">the docs</a> it mentions:</p>
  
  <blockquote>
    <p>Note: the dojo loader includes the nonstandard function require.undef,
    which undefines a module value.</p>
  </blockquote>
  
  <p>But that method is undefined when I call it. Looking at require() in Firebug with:</p>
  
  <pre><code>for( i in require )
  {
      console.log( 'require', i, require[ i ] );
  }
  </code></pre>
  
  <p>require.module has a <code>def()</code> method but not an <code>undef()</code> one.</p>
  
  <p><strong>Edit 2</strong></p>
  
  <p><code>Require.cache</code> only seems to contain dojo and dijit modules. Where are custom namespaced modules cached?</p>