<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"></head><body
 bgcolor="#FFFFFF" text="#000000">
Taskmasters!<br>
  <br>
tl;dr: where you used to do:<br>
  <br>
  <span style="font-family: monospace;">let object = {</span><br 
style="font-family: monospace;">
  <span style="font-family: monospace;">  doAsync: function() {</span><br
 style="font-family: monospace;">
  <span style="font-family: monospace;">    return 
Task.spawn((function*() {</span><br style="font-family: monospace;">
  <span style="font-family: monospace;">      …</span><br 
style="font-family: monospace;">
  <span style="font-family: monospace;">    }).bind(this));</span><br 
style="font-family: monospace;">
  <span style="font-family: monospace;">  }</span><br 
style="font-family: monospace;">
  <span style="font-family: monospace;">};</span><br>
  <br>
You can now do simply:<br>
  <br>
  <span><span style="font-family: monospace;">let object = {</span><br 
style="font-family: monospace;"><span style="font-family: monospace;">
  </span></span><span><span style="font-family: monospace;">doAsync</span></span><span><span
 style="font-family: monospace;">: Task.async(function*() {</span><br 
style="font-family: monospace;">
    <span style="font-family: monospace;">    …</span><br 
style="font-family: monospace;"><span style="font-family: monospace;">
  })</span><br style="font-family: monospace;"><span style="font-family:
 monospace;">};</span><br>
    <br>
Read my blog post for the details:<br>
    <br>
    
<a class="moz-txt-link-freetext" href="http://mykzilla.blogspot.com/2014/03/simplify-asynchronous-method.html">http://mykzilla.blogspot.com/2014/03/simplify-asynchronous-method.html</a><br>
    <br>
-myk<br>
    <br>
  </span>
</body>
</html>