This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Deletes the array of`items`. | |
/// - Parameter items: The array of items to delete. | |
public func delete(_ items: [ItemIdentifierType]) -> [Int] { | |
let deleteItemSet = Set(items) | |
let filterPredicate: (TreeItem<ItemIdentifierType>) -> Bool = { !deleteItemSet.contains($0.value) } | |
/// Depth first traversal to get include all related deleted expanded children | |
let deletedItemsWithRelatedExpandedChildren = Set( | |
items | |
.compactMap { lookup($0) } |