In other way you can get wishlist items collection.
Use factory Magento\Wishlist\Model\ResourceModel\Ite\CollectionFactoryMagento\Wishlist\Model\ResourceModel\Item\CollectionFactory
for getting wishlist product collection and filter that by addCustomerIdFilter($customerId)
protected $_currentUserWishlistCollectionFactory ;
protected $_Customersession;
public function __construct(
\Magento\Wishlist\Model\ResourceModel\Ite\CollectionFactory\Magento\Wishlist\Model\ResourceModel\Item\CollectionFactory $currentUserWishlistCollectionFactory,
\Magento\Customer\Model\Session $Customersession,
) {
....
$this->_Customersession = $Customersession;
$this->_currentUserWishlistCollectionFactory = $currentUserWishlistCollectionFactory;
....
}
public function getcurrentUserWishlistItems(){
$collection = $this->_currentUserWishlistCollectionFactory->create();
$collection->addCustomerIdFilter($this->_Customersession->getCustomerId());
return $collection;
}