7nohe / openapi-react-query-codegen

OpenAPI React Query Codegen is a code generator for creating React Query (also known as TanStack Query) hooks based on your OpenAPI schema.
https://openapi-react-query-codegen.vercel.app
MIT License
298 stars 30 forks source link

Add support for passing Cancelation token source #126

Open chihabhajji opened 5 months ago

chihabhajji commented 5 months ago

Is your feature request related to a problem? Please describe. I'm always frustrated when i'm using a debounced input value and the old pending request result overrides the latest value

Describe the solution you'd like I would like to be able to pass a cancelation source to the queries/mutations

Describe alternatives you've considered queryClient.cancelQueries

Additional context I'm aware that queryClient.cancelQueries does the job, but in terms of performance and DX, being able to pass the cancelation token source is more convinient