facetwp set order of (or remove) flyout facets

<?php
add_action( 'wp_footer', function() {
  ?>
  <script>
  (function($) {
    if ('object' !== typeof FWP) {
        return;
    }
    FWP.hooks.addFilter('facetwp/flyout/facets', function(facets) {
        return ['facet3', 'facet1', 'facet2']; // change the facet display order
    });
  })(jQuery);
  </script>
  <?php
}, 100 );