title: Configure RequireJS modules to return only when initialized
body: <p>I'm using RequireJS to structure my current JS project and I have some libraries/jQuery plugins that need to be initialized before they can be used. The initializing is async and on return will invoke a callback. The following code hence introduces race conditions (is the dependency loaded <strong>and</strong> initialized?):</p>
  
  <p>dep_that_needs_to_be_initialized_before_it_can_be_used.js:</p>
  
  <pre><code>define(
      ['raw_library_source'],
      function(){
          // this init call is async and will invoke the callback when done
          // $ is global
          $.plugin.init({
              //config
          },callback);
      }
  );
  </code></pre>
  
  <p>app.js:</p>
  
  <pre><code>define(
      ['dep_that_needs_to_be_initialized_before_it_can_be_used'],
      function(){
          // the following line may fail in case the dependcy is not yet initialzed
          $.plugin.doSomething();
      }
  );
  </code></pre>
  
  <p>Does anyone know how I could make the require of the dependency 'wait' (aka make it synchronously) until it the library is also initialized?</p>