-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: preserves overloads for non-async functions #22
feat: preserves overloads for non-async functions #22
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this. This works well 🙌 ! Left a couple comments we could look into. We can also circle back to address them on subsequent PRs. Thank you again 💯.
Thanks again for working on this! For regular and async functions I think types are preserved on wrapped functions if we use an explicit return type on the wrapper or type cast the returned wrapped function (newFn)? The limitation is when we want to modify any of the parameter or return types. Do you see this as the case too? |
Thanks for work on this @ahrjarrett. I made a few changes to simplify things and will merge in now! I will rollout the changes to other wrappers next. |
Partially addresses #17
For the async functions you're going to need to do something else (you could probably figure something out by combining the overloads type in the linked TS issue, followed by
UnionToIntersection
?).