Ensures the selected items in lists are correctly updated when the underlying data changes by using `untracked` to avoid circular dependencies. Introduces a utility function to compare sets for equality, preventing unnecessary updates and improving performance.