Replies: 2 comments 11 replies
-
I think you can build that in user-land:
|
Beta Was this translation helpful? Give feedback.
2 replies
-
I will note that function useMultipleMutation(ids: Array<string>){
const ref = useRef<Record<string, any>>({});
ids.forEach((v) => {
// eslint-disable-next-line react-hooks/rules-of-hooks
const result = useMutation(likeTheThing);
ref.current[v] = result;
})
return ref;
} Although this technically breaks rules of hooks, in my test usage of it, it appears to be not problematic. |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey,
We have a method for grouping queries
useQueries
but there isn't one for grouping together multiple mutations.We have some components that contain all the queries and mutations and pass the results down to dumber components and rather than having many variables like
actionFooMutation, actionBazMutation
it would be nice to be able to group them together in a single variable. Something likeetc.
Beta Was this translation helpful? Give feedback.
All reactions