Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function * getData(url){
- var xhr = new XMLHttpRequest();
- xhr.open('GET', url, true);
- xhr.onload = function * () {
- yield this.response;
- };
- xhr.send();
- };
- var d = getData('/mydata');
- console.log(d)
Add Comment
Please, Sign In to add comment