function downloadReaction() {
  const reaction = unloadReaction();
  const binary = reaction.serializeBinary();
  const xhr = new XMLHttpRequest();
  xhr.open('POST', '/reaction/download');
  xhr.onload = () => {
    // Make the browser write the file.
    const url = URL.createObjectURL(new Blob([xhr.response]));
    const link = document.createElement('a');
    link.href = url;
    link.setAttribute('download', 'reaction.pbtxt');
    document.body.appendChild(link);
    link.click();
  };
  xhr.send(binary);
}
/**
 * Downloads the current reaction as a serialized Reaction proto.
 */
Downloads the current reaction as a serialized Reaction proto.
Downloads the current reaction as a serialized Reaction proto .
function downloadReaction() {
  const reaction = unloadReaction();
  const binary = reaction.serializeBinary();
  const xhr = new XMLHttpRequest();
  xhr.open('POST', '/reaction/download');
  xhr.onload = () => {
    const url = URL.createObjectURL(new Blob([xhr.response]));
    const link = document.createElement('a');
    link.href = url;
    link.setAttribute('download', 'reaction.pbtxt');
    document.body.appendChild(link);
    link.click();
  };
  xhr.send(binary);
}
function downloadReaction ( ) { const reaction = unloadReaction ( ) ; const binary = reaction . serializeBinary ( ) ; const xhr = new XMLHttpRequest ( ) ; xhr . open ( 'POST' , '/reaction/download' ) ; xhr . onload = ( ) => { const url = URL . createObjectURL ( new Blob ( [ xhr . response ] ) ) ; const link = document . createElement ( 'a' ) ; link . href = url ; link . setAttribute ( 'download' , 'reaction.pbtxt' ) ; document . body . appendChild ( link ) ; link . click ( ) ; } ; xhr . send ( binary ) ; }
Downloads the current reaction as a serialized Reaction proto.
Downloads the current reaction as a serialized Reaction proto .
// Make the browser write the file.