I am using Recoil for my React project and mostly loving it. I'm familiar with the concepts of atoms, atom families, selectors and selector families. However, I'm struggling to work out how to compose these items together to create a canonical master-details UI in react with efficient rendering.
Imagine we have a list of Foos down the left.
type Foo = { id: string; name: string; description: string, counter: number }
At anyone time there is a currently selected Foo (or no selected Foo). When I edit a Foo I would like the list details to also update in real-time, but without repainting the whole list on the left.
I've tried many combinations of atoms, selectors and families but in the end I end up re-painting EVERYTHING all the time.
Also, assume the UI allows you to add new Foos.
Would love your thoughts on how to compose this canonically using Recoil.