-
Notifications
You must be signed in to change notification settings - Fork 6
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
Want to use if/else condition #19
Comments
Thanks for the report! It's interesting that we do use this same pattern quite extensively in our internal code. However, we have compilerOptions.strict enabled in our tsconfig.json files, and disabling it causes TypeScript start giving out the errors you describe. That makes me think that this behavior is likely related to the TypeScript issue microsoft/TypeScript#10564. As such there's not much we can do on the library level, so I recommend you try one of the following approaches:
|
Thanks for the reply! I will try to deal with this I hopefully this gets fixed in Typescript 👍 |
Thanks for the great library.
I would like to use the following
However, I get a compile error ”console.log(res.error);”, and I'm thinking the typescript compiler is not able to infer types.
It returns the following error
To pass through the compiler, Explicit type definitions are necessary, but not elegant.
Is there a simpler way to define it, or a way to customize the library itself?
The text was updated successfully, but these errors were encountered: