function renderBody(err, data) {
    if (awaitInfo.finished) {
      return;
    }

    if (err) {
      awaitInfo.error = err;
    }

    if (!beforeRenderEmitted) {
      beforeRenderEmitted = true;
      out.emit("await:beforeRender", awaitInfo);
    }

    renderContents(err, data, input, asyncOut);

    awaitInfo.finished = true;

    if (clientReorder) {
      asyncOut.end();
      out.flush();
    } else {
      // When using client reordering we want to delay
      // this event until after the code to move
      // the async fragment into place has been written
      let asyncLastOut = asyncOut.beginAsync(LAST_OPTIONS);
      asyncOut.onLast(function () {
        var oldWriter = asyncOut.writer;
        // We swap out the writer so that writing will happen to our `asyncLastOut`
        // even though we are still passing along the original `asyncOut`. We have
        // to pass along the original `asyncOut` because that has contextual
        // information (such as the rendered UI components)
        asyncOut.writer = asyncLastOut.writer;
        out.emit("await:finish", awaitInfo);
        asyncOut.writer = oldWriter;
        asyncLastOut.end();
        out.flush();
      });

      asyncOut.end();
    }
  }
SHOULD MATCH THE reorder-renderer.js IMPLEMENTATION