-
-
Notifications
You must be signed in to change notification settings - Fork 852
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
Version 1.9.1 produce Typescript type inference is partly broken #270
Comments
@benneq Yeah, your fix is spot on. The fix will be out in a sec. |
Ah, I see, you were faster than me figuring this out :D |
edit: Wait.. nevermind. |
Thank you. That's really good to know :) |
Yeah it's one of those rites of passage when wrapping your head around Typescript. 😆 |
Thanks for the bug report! ❤️ |
I come from a Java background, and it's sometimes really confusing, because TypeScript's type system can do really weird things. It's really mighty. Sometimes I really miss some of it's features when writing Java code. And sometimes my brain starts to hurt when I look at some really complex TypeScript typings, like "extends with generics" or "infer" :D But the good thing is: As long it's part of some external library (like yours) I don't have to care about the really complex stuff. Thanks for that! |
🎉 This issue has been resolved in version 1.9.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Whoops, I forgot to remove the |
So far 1.9.2 works! But I guess, I have another issue with typings. I'll open a new issue in a few minutes. Maybe you can fix the |
Sample Code from
readme.md
:Type of
nextState
isvoid
. It works correctly when I addreturn draftState
at the end. Is this intended?In my opinion there's no(?) case where
produce
shouldn't return anything. In other words:produce
should always return something. Or am I wrong?EDIT: I'm not entirely sure, but I think the typings should look something like that:
Old:
New:
The text was updated successfully, but these errors were encountered: