[react-packager][streamline oss] Move open sourced JS source to react-native-github

This commit is contained in:
Spencer Ahrens
2015-02-19 20:10:52 -08:00
commit efae175a8e
434 changed files with 44658 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
/**
* @providesModule XHR
*/
function request(method, url, callback) {
var xhr = new XMLHttpRequest();
xhr.open(method, url);
xhr.onreadystatechange = function() {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
callback(null, xhr);
} else {
callback(new Error('status = ' + xhr.status, xhr));
}
}
};
xhr.send();
}
exports.get = function(url, callback) {
request('GET', url, callback);
};