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

Function Page

packages/solid-query/src/__tests__/useMutation.test.tsx:37–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35
36 it('should be able to reset `data`', async () => {
37 function Page() {
38 const mutation = useMutation(() => ({
39 mutationFn: () => Promise.resolve('mutation'),
40 }))
41
42 return (
43 <div>
44 <h1>{mutation.data ?? 'empty'}</h1>
45 <button onClick={() => mutation.reset()}>reset</button>
46 <button onClick={() => mutation.mutate()}>mutate</button>
47 </div>
48 )
49 }
50
51 const rendered = renderWithClient(queryClient, () => <Page />)
52

Callers

nothing calls this directly

Calls 11

sleepFunction · 0.90
setActTimeoutFunction · 0.90
countFunction · 0.85
setResultFunction · 0.85
useMutationFunction · 0.50
resetMethod · 0.45
mutateMethod · 0.45
cancelQueriesMethod · 0.45
getQueryDataMethod · 0.45
setQueryDataMethod · 0.45
invalidateQueriesMethod · 0.45

Tested by

no test coverage detected