restful-react icon indicating copy to clipboard operation
restful-react copied to clipboard

useMutate should take a debounce parameter

Open malko opened this issue 4 years ago • 1 comments

Is your feature request related to a problem? Please describe. I find useful the debounce parameter in useGet and would appreciate to have it on useMutate too, or i'm i missing the point to achieve this.

Describe the solution you'd like I'd like to be able to pass a debounce parameter to useMutate like this:

const {mutate, error} = useMutate({
  verb: 'PATCH',
  path: ({id}) => `/entity/${id}`,
  debounce: true
})

Describe alternatives you've considered using useDebounceCallback may be an option, but it force me to have another dependencies I don't require otherwise at the moment.

malko avatar Nov 18 '21 18:11 malko

Indeed, we don’t have any debounce property on useMutate. So far I don’t really have the time to work on this project anymore but I’m always happy to review PR if you want to take care of this 😃

fabien0102 avatar Nov 20 '21 15:11 fabien0102