(opts?: {
wait?: number
trailing?: boolean
leading?: boolean
})
| 173 | |
| 174 | // Simulate the exact user scenario: custom hook wrapping usePacedMutations |
| 175 | const useDebouncedTransaction = (opts?: { |
| 176 | wait?: number |
| 177 | trailing?: boolean |
| 178 | leading?: boolean |
| 179 | }) => { |
| 180 | return usePacedMutations({ |
| 181 | onMutate, |
| 182 | mutationFn, |
| 183 | strategy: debounceStrategy({ |
| 184 | wait: opts?.wait ?? 3000, |
| 185 | trailing: opts?.trailing ?? true, |
| 186 | leading: opts?.leading ?? false, |
| 187 | }), |
| 188 | }) |
| 189 | } |
| 190 | |
| 191 | const { result, rerender } = renderHook(() => useDebouncedTransaction()) |
| 192 |
no test coverage detected