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

Function Mutate

packages/solid-query/src/__tests__/useMutationState.test.tsx:30–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28 }
29
30 function Mutate() {
31 const mutation = useMutation(() => ({
32 mutationKey,
33 mutationFn: (input: number) => sleep(150).then(() => 'data' + input),
34 }))
35
36 return (
37 <div>
38 <button onClick={() => mutation.mutate(1)}>mutate</button>
39 </div>
40 )
41 }
42
43 function Page() {
44 return (

Callers

nothing calls this directly

Calls 3

sleepFunction · 0.90
useMutationFunction · 0.50
mutateMethod · 0.45

Tested by

no test coverage detected