mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-21 00:49:17 +01:00
Add mutationKey everywhere
This commit is contained in:
@@ -32,6 +32,7 @@ export function useKeyValue<T extends Object | null>({
|
||||
});
|
||||
|
||||
const mutate = useMutation<void, unknown, T>({
|
||||
mutationKey: ['set_key_value', namespace, key],
|
||||
mutationFn: (value) => setKeyValue<T>({ namespace, key, value }),
|
||||
// k/v should be as fast as possible, so optimistically update the cache
|
||||
onMutate: (value) => queryClient.setQueryData<T>(keyValueQueryKey({ namespace, key }), value),
|
||||
|
||||
Reference in New Issue
Block a user