-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Open
Labels
Description
Is your feature request related to a problem? Please describe.
It can be hard to read the code and can introduce bugs when using normal function parameters, for instance, if you have this:
api.getMembers(orgId, offset, limit, sortBy, sortOrder, options)
and the backend adds an argument websiteId, after orgId, depending on the types of the items it won't necessarily cause a type error.
Describe the solution you'd like
I would like the option to pass in the parameters as an object
Describe alternatives you've considered
For now, I am manually creating helper functions like this, but it's still a hassle to make sure to keep them up to date, it would be nicer to have the security of having objects here so that if anything at all is wrong, it will give a type error
getMembers: ({ orgId, offset, limit, sortBy, sortOrder, options }: GetOrgMembersReq) =>
api.getMembers(orgId, offset, limit, sortBy, sortOrder, options)
Additional context
No additional context, let me know if you have any questions
Reactions are currently unavailable