Skip to content

Instantly share code, notes, and snippets.

View koldovsky's full-sized avatar

Vyacheslav Koldovskyy koldovsky

View GitHub Profile
@koldovsky
koldovsky / index.js
Created March 20, 2017 10:47 — forked from chrisbuttery/index.js
Control the flow of asynchronous calls with ES6 generator functions
/**
* get - XHR Request
*/
let get = function (url) {
return function (callback) {
let xhr = new XMLHttpRequest();
xhr.open('GET', url);
xhr.onreadystatechange = function() {
let response = xhr.responseText;