Discover · saket.me

Simplifying DiffUtil with RxJava

Saket Narayan saket.me

One of my favorite parts of RxJava is that no matter how complex a state management usecase is, there’s always an operator for that. During a recent code cleanup, I found a very cool usecase of RxJava’s scan() and compose() operators for simplifying the usually verbose DiffUtil implementation.

I had been delaying writing this post for a while, but Mark Allison’s new series of articles on adding item change animations to RecyclerView have finally pushed me to finish this.

More ways to use this
Open on another device
Scan this QR code to open the same public page

Scan to open this page. Your saved notes and account access are not included.

Download QR code

Open the page link

Named in it

Keep going

Each of these is read from what this estate already kept: the feed a piece came through, the publisher behind it, the credits and topics the publisher printed. None of it is a recommendation, an identity or a record kept anywhere else.

Also from Saket Narayan

  1. Writing interactive screenshot tests in Compose UI with Touch RobotSaket Narayan saket.me
  2. Generating rich link previews 10x fasterSaket Narayan saket.me
  3. The pursuit of fast feedback loopsSaket Narayan saket.me
  4. Building a sub-sampling image viewer for Compose UISaket Narayan saket.me
  5. Drawing custom text spans in Compose UISaket Narayan saket.me
  6. Graduating from View IDsSaket Narayan saket.me