title: disable previous arrow only one time in slick slider
body: <p>I have written a javascript function to disable "previous" arrow when the current slide is 0, and disable "next" arrow when i have reached the last slide. I want the "previous" arrow to be disabled only once when the page loads, and after that even after reaching the first slide(current slide: 0) i want the "previous" arrow to be visible. Currently, i have 3 slides (0,1,2)</p>
  
  <p>I tried using onload() function to hide the arrow only on loading for the first time, but that didn't work. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(function(){  
    $('.hero-slider').slick({ 
          slidesToShow: 1,
          slidesToScroll: 1,
          arrows: true,
          dots:false,
          infinite: true
      });
    var currentSlide = $('.hero-slider').slick('slickCurrentSlide');
      if(currentSlide==0)
      {
          $('.slick-prev').hide();
      }
      else if(currentSlide==2)
      {
          $('.slick-next').hide();
      }
  });
  
  $('.hero-slider').on('afterChange', function(){
    console.log($('.hero-slider').slick('slickCurrentSlide'));
    var currentSlide = $('.hero-slider').slick('slickCurrentSlide');
      if(currentSlide==0)
      {
          $('.slick-prev').hide();
          $('.slick-next').show();
      }
      else if(currentSlide==2)
      {
          $('.slick-next').hide();
          $('.slick-prev').show();
      }
      if(currentSlide&gt;0 &amp;&amp; currentSlide&lt;2)
      {
          $('.slick-prev').show();
          $('.slick-next').show();
      }
  });</code></pre>
  </div>
  </div>
  </p>