Redirect when a facet is interacted with

<script>
  
  (function($) {
    $(document).on('facetwp-refresh', function() {
        if (FWP.loaded && '' == FWP_HTTP.uri) { // if not the initial pageload, and we're on the homepage
            window.location.href = '/listings/?' + FWP.build_query_string(); // redirect
        }
    });
})(jQuery);

</script>