editor/js/reaction.js
// For testing, compare a local Dataset to a Dataset on the server.
For testing, compare a local Dataset to a Dataset on the server.
For testing compare a local Dataset to a Dataset on the server .
async function compareDataset(fileName, dataset) {
  return new Promise((resolve, reject) => {
    const xhr = new XMLHttpRequest();
    xhr.open('POST', '/dataset/proto/compare/' + fileName);
    const binary = dataset.serializeBinary();
    xhr.onload = () => {
      if (xhr.status == 200) {
        resolve();
      } else {
        reject();
      }
    };
    xhr.onerror = reject;
    xhr.send(binary);
  });
}
async function compareDataset ( fileName , dataset ) { return new Promise ( ( resolve , reject ) => { const xhr = new XMLHttpRequest ( ) ; xhr . open ( 'POST' , '/dataset/proto/compare/' + fileName ) ; const binary = dataset . serializeBinary ( ) ; xhr . onload = ( ) => { if ( xhr . status == 200 ) { resolve ( ) ; } else { reject ( ) ; } } ; xhr . onerror = reject ; xhr . send ( binary ) ; } ) ; }
For testing, compare a local Dataset to a Dataset on the server.
For testing compare a local Dataset to a Dataset on the server .