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

Support overloaded functions (TypeScript types) #48

Merged
merged 3 commits into from
Nov 29, 2019

Conversation

fregante
Copy link
Collaborator

@fregante fregante commented Nov 16, 2019

Fixes #46

The problem was that the input function was being broken into ...Arguments and ReturnType and then recomposed as mem’s return. This apparently picked up just one of the overloads and discarded the rest.

I tested this in Refined GitHub and it fixed my problems: https://github.com/sindresorhus/refined-github/pull/2545/files#diff-98a7886093e2e560968c34d6c4707b22L24-L29

@fregante
Copy link
Collaborator Author

cc @BendingBender to possibly double-check

We are testing that the types of `mem(fn)` are identical to `fn`’s after all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatically get types from memoized function
1 participant