How to compare previous vs updated data? - TanStack