Zend certified PHP/Magento developer

Slick and Unslick magento 2 widget product grid based on condition

I have Initialized slick carousal to magento 2 widget product grid. Now i was trying to unslick if the gird have less than 6 product and if a grid have more than 6 product slick need to be initialized.. unfortunately unslick condition is working slick condition is not working as expected .. could anyone have a solution for this issue