Try type gurads#608
Merged
subdavis merged 2 commits intoMar 2, 2021
Merged
Conversation
Collaborator
|
I'll do a more in-depth review tomorrow morning but this looks similar to what I was thinking but I was a bit too lazy to look into implementation. The one thing that still feel weird with the type guards is that it seems like you're double declaring the type. I wish there was a better way to do it while utilizing the existing type. Only other additional thing I think is that the types and functions for |
BryonLewis
approved these changes
Mar 2, 2021
Collaborator
BryonLewis
left a comment
There was a problem hiding this comment.
I like this a lot better than my code duplication.
BryonLewis
added a commit
that referenced
this pull request
Mar 3, 2021
* useAttributes base * fixing web version * Updating backend and fixing some metadata issues * mend * adressing my own review * Try type gurads (#608) * Try type gurads * markChangesPending update (#609) Co-authored-by: BryonLewis <61746913+BryonLewis@users.noreply.github.com> * linting fixes * Addressing comments, fixing desktop Co-authored-by: Brandon Davis <brandon.davis@kitware.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bryon, I saw your comment and it looked like this might be a good use of type guards.
I haven't tested this, I'm not even 100% sure this is a good solution. I'm more just interested in if you think this is better style or provides more safety.
Risks to this change:
LMK what you think.