Skip to content

Instantly share code, notes, and snippets.

@nesbtesh
Created August 17, 2016 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nesbtesh/22e46dedfbbd7a34e49427e776435b06 to your computer and use it in GitHub Desktop.
Save nesbtesh/22e46dedfbbd7a34e49427e776435b06 to your computer and use it in GitHub Desktop.
Generators ES6
function* getStockValue() {
var entry1 = yield request('http://myrl.com/stock/key');
var data1 = JSON.parse(entry1);
var entry2 = yield request('http://myurl/stock/value');
var data2 = JSON.parse(entry2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment