title: Lightweight implementation of promises
body: <p>I am building a simple charting tool. When a user chooses a data source and a chart type, both the data and the script for the specific chart (.js) are loaded and then the code renders the chart.</p>
  
  <p>Currently I use the following sequence:</p>
  
  <ol>
  <li>Load the chart script</li>
  <li>Load the data</li>
  <li>Render the chart</li>
  </ol>
  
  <p>To improve performance, I'd like to implement promises and load script and data in parallel. A library like jQuery is too big for my needs (the point of the question is not to argue on this), are there more lightweight solutions? Maybe a 1-2 kb library, or a tutorial? Again, this is a very basic implementation with just two actions in parallel.</p>
  
  <p>[Update] I upvoted all the replies as they all look excellent. I'll report back after I do some more testing.</p>