etc/browser-demo/src/index.js
function windowReadiness({ document }) {
  if (document.readyState === "loading") {
    // Loading hasn't finished yet
    return new Promise((resolve, reject) =>
      document.addEventListener("DOMContentLoaded", resolve)
    );
  }
  // it's ready
}
function windowReadiness({ document }) {
  if (document.readyState === "loading") {
    // Loading hasn't finished yet
    return new Promise((resolve, reject) =>
      document.addEventListener("DOMContentLoaded", resolve)
    );
  }
  // it's ready
}
function windowReadiness ( { document } ) { if ( document . readyState === "loading" ) { // Loading hasn't finished yet return new Promise ( ( resolve , reject ) => document . addEventListener ( "DOMContentLoaded" , resolve ) ) ; } // it's ready }
Promise of DOM ready event in the provided document
Promise of DOM ready event in the provided document