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

Function Mutates

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

Source from the content-addressed store, hash-verified

1008 it('should not change state if unmounted', async () => {
1009 const states: Array<UseMutationResult['status']> = []
1010 function Mutates() {
1011 const mutation = useMutation(() => ({ mutationFn: () => sleep(10) }))
1012 createRenderEffect(() => {
1013 states.push(mutation.status)
1014 })
1015 return <button onClick={() => mutation.mutate()}>mutate</button>
1016 }
1017 function Page() {
1018 const [mounted, setMounted] = createSignal(true)
1019 return (

Callers

nothing calls this directly

Calls 3

sleepFunction · 0.90
useMutationFunction · 0.50
mutateMethod · 0.45

Tested by

no test coverage detected