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

Enable branching type inference in union type param #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kwonoj
Copy link
Collaborator

@kwonoj kwonoj commented Mar 14, 2017

This PR adds small amend for discussions enabling type inference for union type branches.

Few notes:

why not global-augument?

: since lodash.isFunction is untyped module, so no augumentation is possible.

name typedIsFunction

: I just picked random name for this, can apply any way you'd prefer. To preserve name, you could think to use require like below instead of import syntax.

const isFunction: (val: any) => val is Function = require('lodash.isFunction')....

@anaisbetts
Copy link
Owner

We should probably export all of the isXYZ methods from utils, I'll have a look. Thanks for the val is BLAH tip!

@kwonoj
Copy link
Collaborator Author

kwonoj commented Mar 14, 2017

@paulcbetts yup, feel freely close PR. this is demonstration purpose and code might need to be updated as needed.

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

Successfully merging this pull request may close these issues.

None yet

2 participants