Closed mc-petry closed 1 year ago
This shouldn't be very complicated to implement, we only need to expose a new function createMutationKeys
with the same signature as createQueryKeys
but changing queryFn
and queryKey
to mutationFn
and mutationKey
.
Would you like to contribute to that with a PR @mc-petry ?
@mc-petry support for mutations is now available in https://github.com/lukemorales/query-key-factory/releases/tag/v1.2.0
Shoutout to @s-bondarenko for the contribution!
Hi @lukemorales, would it be possible to create an example in the readme, I am unsure of how to use this in the way I would like - my goal is to use the new createMutationKeys
to automatically update state that instead of manually having to use setQueryData
and onSuccess
in the useMutation
function
Is that possible?
I want to be able to do something like that:
I needed this to be able to use useIsMutating hook.