-
Notifications
You must be signed in to change notification settings - Fork 642
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
fix typescript types after type optimization and cast, add castToSnapshot and castToReferenceSnapshot #1074
Conversation
@mweststrate thoughts about the addition of castToSnapshot? |
Maybe we could advice the users to use getSnapshot instead? |
well, that's what mst does internally, but one of its key features is that it also supports constructs such as this
to do that otherwise you'd have to either force cast it to or with getSnapshot something like
which would be unneeded code (and I think won't compile, not 100% sure) |
Just made sure the .d.ts files generated don't get bigger (spoiler: they don't, they are exactly the same) |
@mweststrate pr done |
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.
@xaviergonz changes look good to me! (Granted, my review was quite superficial, as you are now way deeper into the subtleties of the TS type system then I am :)).
One question, did you check whether this negatively impacts the compilation / autocompletion speed, just to not undo the benefits of the previous PR?
Thanks!
Yep I did! Quoting myself
|
Doh! Approved then :)
Op ma 19 nov. 2018 om 16:56 schreef Javier Gonzalez <
[email protected]>:
… Yep I did! Quoting myself
Just made sure the .d.ts files generated don't get bigger (spoiler: they
don't, they are exactly the same)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1074 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABvGhP8MUTqKDGwvOA-UjUZRTfh77rC-ks5uwtSYgaJpZM4YTqBq>
.
|
Basically since the fix to make types faster apparently some stuff got broken. This PR fixes:
Additionally: