Open History to see the last commit
1<script lang="ts">
2 import { createMutation } from '../../src/index.js'
3 import { sleep } from '@tanstack/query-test-utils'
4β
5 const mutation = createMutation(() => ({
6 mutationKey: ['mutation-1'],
7 mutationFn: async () => {
8 await sleep(10)
9 return 'data'
10 },
11 }))
12</script>
13β
14<button onclick={() => mutation.mutate()}>Trigger</button>