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

Function Mutations

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

sleepFunction · 0.90
useMutationFunction · 0.50

Tested by

no test coverage detected