Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQ] [typescript-fetch] useSingleRequestParameter should mark parameter optional if all properties are optional #11112

Closed
davidgamero opened this issue Dec 13, 2021 · 2 comments · Fixed by #11135

Comments

@davidgamero
Copy link
Contributor

davidgamero commented Dec 13, 2021

Is your feature request related to a problem? Please describe.

when useSingleRequestParameter has all optional parameters, an empty object still has to be passed producing myApiCall({})

Describe the solution you'd like

Functions with all optional parameters should include a default empty object parameter to make it optional instead of myApiCall({})

When the default is in place, we can instead use myApiCall()

See #6477 and related #6440

Describe alternatives you've considered

Instead of making the parameter object itself optional, we can use the solution employed in the referenced PR to default which will effectively make it optional too

Additional context

@gambtho
Copy link

gambtho commented Dec 14, 2021

resolves a problem we were having also, thanks @davidgamero

@Marcus-Hines
Copy link

I would love to see this change made.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants