title: Using promise within generators
body: <p>I'm having a issue with my promise being returned within my generator when I attempt to iterate on it. I'm using the NPM Twitter module, and promisifying it with Bluebird.js. It is to my understanding that when I call the first g.next(), the program will execute until the yield statement, then eveluate to the right. Upon the second next() call, the program would then assign the value returned from the promise into the x variable. Instead, I'm getting a value of undefined, even when I try to log the value of 'x' within the function. The first g.next() does log out a object displaying that i did return a successful promise (see screenshot below). Maybe I'm thinking about this all wrong, but I'm really confused on how this does not work. Any and all help will be greatly appreciated.</p>
  
  <pre><code>var Promise = require('bluebird');
  
  var Twitter = require('twitter');
  
  var client = 
  Promise.promisifyAll(
  new Twitter({
    consumer_key: '*********',
    consumer_secret: '********',
    access_token_key: '********',
    access_token_secret: '******'
  }));
  
  
  function *go(){
  
    var x = yield client.getAsync('statuses/user_timeline');
    console.log(x);
  
  };
  
  
  var g = go();
  
  console.log(g.next().value);
  console.log(g.next().value);
  </code></pre>
  
  <p>Screenshot: </p>
  
  <p><a href="https://i.stack.imgur.com/qveDY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qveDY.png" alt="enter image description here"></a></p>