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