title: Design pattern for processes reporting that they're done (in React)
body: <p>I'm rendering a page in a web application.<br>
  The page requires several subcomponents to be initialized and populated with data before the UI is rendered.  </p>
  
  <p>Let's say I have 3 subcomponents called <code>compA</code>, <code>CompB</code> and <code>compC</code> that need to be initialized with data before the component <code>UserView</code> can be rendered and displayed to the enduser.</p>
  
  <p>How would I go about telling <code>UserView</code> that it can be rendered?<br>
  I'll use React components as an example but really I'm looking for a general solution that would be preferred to solve this type of problem (see explaination below code):</p>
  
  <pre><code>var UserView = React.createClass({
  
    getInitialState: function() {
      return {
          readyToRender: false
      };
    },
  
    componentWillMount: function() {
      initComp("A");
      initComp("B");
      initComp("C");
    },
  
    initComp(component): function() {
      // do stuff
      reportReady(component);
    },
  
    render: function() {
      if (this.state.readyToRender) {
          return (
              &lt;div&gt;
              &lt;CompA data={this.state.compAdata} /&gt;
            &lt;CompB data={this.state.compBdata} /&gt;
            &lt;CompC data={this.state.compCdata} /&gt;
            &lt;/div&gt;
          );
      } else
          return false;
    }
  });
  </code></pre>
  
  <p>For those unfamiliar with React:<br>
  <code>getInitialState</code> is called once to set the initial state of <code>UserView</code>.<br>
  <code>componentWillMount</code> is called once before rendering <code>UserView</code>, before <code>render</code>.<br>
  <code>render</code> is called whenever the state of <code>UserView</code> has changed and the component needs to be re-rendered.</p>
  
  <p>Is this design pattern preferable to solve this problem?<br>
  Furthermore, how would I go about implementing <code>reportReady(component)</code> and how should I store the results? (Maybe as an array of booleans?)</p>