Replies: 1 comment 2 replies
-
It's a common practice to use an atom to store an "index" for another atom family. You can access other atom/selector values from an atom effect using If you're dealing with batching atom syncs you may find the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We want to fetch all the atoms in a family and then make a POST request with these atoms to update an API.
We considered using the atom families effects to update one by one, but if a single call fails then our state and external database will be out of sync. So instead of making a call every update, we just want to send the entire family to a request to update everything, how would one do this?
Also, is there a way to "get" other atoms/selectors in the effects of an atom family? We have other atoms we need to reference to make API calls, and don't want to have to duplicate that data for each atom family item to make the call if we did individual updates from an effect. Plus when you reset an atom to its default id, having just the id isn't helpful to make an api call since if it follows openAPI spec, you don't have the other data required to make the api call.
Beta Was this translation helpful? Give feedback.
All reactions