Force refresh on initial page load

<?php
add_action( 'facetwp_scripts', function() {
    ?>
      <script>
        document.addEventListener('facetwp-refresh', function() {
            if ( !FWP.loaded ) {
                FWP.setHash();
                FWP.fetchData();
            }
        });
      </script>
    <?php
  }, 100 );