Masonry infinite scroll event

This gets asked a lot, we use WP core masonry so we can use its built in events. This example fires AFTER you click load more and AFTER masonry has added new posts

(function($){
    $(document).ready(function(){
        $('.fl-builder-pagination-load-more .fl-button').on( 'click', function(){
            $('.fl-post-grid').one( 'layoutComplete', function( event, items ) {
            console.log(event)
            console.log(`Appended ${items.length} items`);
            });
        });
    });
})(jQuery);