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

Function Mutations

packages/preact-query/src/__tests__/useMutationState.test.tsx:32–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

sleepFunction · 0.90
useMutationFunction · 0.50

Tested by

no test coverage detected