src/IO/Core/DataManager/request.js
function makeRequest(url, handler) {
  const xhr = new XMLHttpRequest();

  xhr.open('GET', url, true);
  xhr.responseType = handler.type;

  xhr.onload = function onLoad(e) {
    if (this.status === 200 || this.status === 0) {
      handler.fn(null, xhr);
      return;
    }
    handler.fn(e, xhr);
  };
  xhr.onerror = function onError(e) {
    handler.fn(e, xhr);
  };
  xhr.send();
}
function makeRequest(url, handler) {
  const xhr = new XMLHttpRequest();

  xhr.open('GET', url, true);
  xhr.responseType = handler.type;

  xhr.onload = function onLoad(e) {
    if (this.status === 200 || this.status === 0) {
      handler.fn(null, xhr);
      return;
    }
    handler.fn(e, xhr);
  };
  xhr.onerror = function onError(e) {
    handler.fn(e, xhr);
  };
  xhr.send();
}
function makeRequest ( url , handler ) { const xhr = new XMLHttpRequest ( ) ; xhr . open ( 'GET' , url , true ) ; xhr . responseType = handler . type ; xhr . onload = function onLoad ( e ) { if ( this . status === 200 || this . status === 0 ) { handler . fn ( null , xhr ) ; return ; } handler . fn ( e , xhr ) ; } ; xhr . onerror = function onError ( e ) { handler . fn ( e , xhr ) ; } ; xhr . send ( ) ; }
Generic request handler
Generic request handler