code: function windowReadiness({ document }) {
    if (document.readyState === "loading") {
      // Loading hasn't finished yet
      return new Promise((resolve, reject) =>
        document.addEventListener("DOMContentLoaded", resolve)
      );
    }
    // it's ready
  }
docs: Promise of DOM ready event in the provided document