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

do some ts magic to get around the switch setup #46

Merged

Conversation

fzhao99
Copy link
Collaborator

@fzhao99 fzhao99 commented Oct 22, 2024

Adds a few utility classes to get around Typescript union type wonkiness

@fzhao99 fzhao99 marked this pull request as ready for review October 22, 2024 17:06
@fzhao99 fzhao99 changed the title do some ts magic to get around the switch case do some ts magic to get around the switch setup Oct 22, 2024
): Promise<unknown[]> {
let resourceArray: unknown[] = [];
): Promise<FhirResource[]> {
let resourceArray: FhirResource[] = [];
Copy link
Collaborator Author

@fzhao99 fzhao99 Oct 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robertandremitchell pushed the type checking from where you had it down a level to where we're making contact against the relevant FHIR response, which feels like the part of the stack where we should check for it. RN just logging out a mismatch in the event that we have an issue rather than "properly" handling the issue based on the scope of the ticket, but lmk if you have any issues here

Also renamed the function accordingly

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that makes sense. I had tinkered with moving it yesterday but it felt like it was getting more complex. this definitely simplifies it a lot, which is great!

Copy link
Collaborator

@robertandremitchell robertandremitchell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

): Promise<unknown[]> {
let resourceArray: unknown[] = [];
): Promise<FhirResource[]> {
let resourceArray: FhirResource[] = [];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that makes sense. I had tinkered with moving it yesterday but it felt like it was getting more complex. this definitely simplifies it a lot, which is great!

@fzhao99 fzhao99 merged commit 23ca516 into rob/2783-fix-errors-generated-by-eslintrcjson Oct 22, 2024
4 checks passed
@fzhao99 fzhao99 deleted the bob/fix-ts-error branch October 22, 2024 17:44
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.

2 participants