I'm researching how to use RecoilJS in my application, and I like the concept of an atomFamily - which seems like a great way to keep track of individual items in a list while keeping the app performant, due to each item's updates not forcing a refresh of the entire list.
I want to load a set of data, let's say items of a todo list (to give a canonical example) from a remote server in an async way and then initialize the atomFamily and create a react component from each of these items.
My first thought is to create a useEffect hook. In it I'd fetch the data, then run a for-loop and call atomFamily to create atoms for each each of the items.
But then I started reading about selectorFamily - it sounds like that may be the right approach? Also, there are atom effects (unstable) that look like they might be the correct way to do this instead of using normal useEffect hooks? Now I'm confused about the right way to proceed here and I haven't found a lot of info on the internet about this.
Can you please kindly point me in the right direction? What's the appropriate way to load data and then pull it into the Recoil system? AtomFamily, selectorFamily? Am I even on the right track here?
Thanks in advance for your help,
Greg