title: Rails 6 + webpack + turbolinks : not working at first page load
body: <p>I'm trying to understand how to properly init a JS lib in Rails 6 with turbolinks.</p>
  
  <p>For example I got this in my webpack JS file (not application.js but another one I load with a <code>pack_tag</code>):</p>
  
  <pre><code>$(document).on('turbolinks:load', function() {
    $('.carousel').slick();
     AOS.init();
     startFlexImages();
  }
  </code></pre>
  
  <p>Slick is properly loaded everytime, but the other libs are not.
  Though I noticed that if I navigate through the website and come back to the page, they init properly, like if they were initialized after page is fully loaded</p>
  
  <p>Found this topic about it : <a href="https://github.com/turbolinks/turbolinks/issues/534" rel="nofollow noreferrer">https://github.com/turbolinks/turbolinks/issues/534</a>
  But I do not understand the answer of the guy that closed the topic, if somebody could explain me ?</p>
  
  <p>Thank you</p>