MCPcopy Create free account
hub / github.com/TanStack/query / Mutations

Function Mutations

packages/react-query/src/__tests__/useMutationState.test.tsx:31–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29 }
30
31 function Mutations() {
32 const { mutate: mutate1 } = useMutation({
33 mutationKey: key1,
34 mutationFn: () => sleep(50).then(() => 'data'),
35 })
36 const { mutate: mutate2 } = useMutation({
37 mutationKey: key2,
38 mutationFn: () => sleep(10).then(() => 'data'),
39 })
40
41 return (
42 <div>
43 <button onClick={() => mutate1()}>mutate1</button>
44 <button onClick={() => mutate2()}>mutate2</button>
45 </div>
46 )
47 }
48
49 function Page() {
50 return (

Callers

nothing calls this directly

Calls 2

sleepFunction · 0.90
useMutationFunction · 0.50

Tested by

no test coverage detected