     }
     
     func updateListViewModels(listViewModel: [DiffListGroupViewModel], updateType: DiffListViewController.ListUpdateType) {
-        
-        //todo: check cache here?
         
         switch updateType {
         case .itemExpandUpdate(let indexPath):

    override func viewDidLayoutSubviews() {
        super.viewDidLayoutSubviews()
        
        if updateWidthsOnLayoutSubviews {
            backgroundUpdateListViewModels(listViewModel: dataSource, updateType: .widthChangedUpdate(width: collectionView.frame.width)) {
                //self.collectionView.collectionViewLayout.invalidateLayout()
                self.applyListViewModelChanges(updateType: .widthChangedUpdate(width: self.collectionView.frame.width))
                self.updateWidthsOnLayoutSubviews = false
            }
        }
    }
    
    override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
        super.viewWillTransition(to: size, with: coordinator)
        
        updateWidthsOnLayoutSubviews = true
        coordinator.animate(alongsideTransition: { (context) in
            //nothing
        }) { (context) in
            self.updateWidthsOnLayoutSubviews = false
        }
        
//        backgroundUpdateListViewModels(listViewModel: dataSource, updateType: .widthChangedUpdate(width: size.width)) {
//            self.applyListViewModelChanges(updateType: .widthChangedUpdate(width: size.width))
//        }
    }
    
    override func willTransition(to newCollection: UITraitCollection, with coordinator: UIViewControllerTransitionCoordinator) {
        super.willTransition(to: newCollection, with: coordinator)
        
        //updateListViewModels(listViewModel: dataSource, updateType: .fontOrMarginUpdate(traitCollection: traitCollection))
        //applyListViewModelChanges(updateType: .fontOrMarginUpdate(traitCollection: traitCollection))
    }
    
    override func scrollViewDidScroll(_ scrollView: UIScrollView) {

        switch updateType {
        case .itemExpandUpdate:
            collectionView.setCollectionViewLayout(UICollectionViewFlowLayout(), animated: true)
        case .initialLoad, .fontOrMarginUpdate:
            collectionView.reloadData()
        case .widthChangedUpdate:
            //collectionView.reloadData()
            //collectionView.collectionViewLayout.invalidateLayout()
            collectionView.setCollectionViewLayout(UICollectionViewFlowLayout(), animated: true)
        default:
            break
        }
