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.
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
RJS-2867: Add useProgress and tests #6804
RJS-2867: Add useProgress and tests #6804
Changes from 1 commit
865cf14
867925a
5982384
5759bd1
3ec2d0f
437725f
a018089
cd07ad5
a98a1cd
1ad08db
a9fb1ef
281009d
8fbafb0
8982c2a
f0d8586
5c82baa
0ca874a
efcf58b
5e5f28c
cf656f4
a532718
e41f294
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I'm sure this could be written without the type assertion 🤞
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.
unfortunately not, it thinks of itself as an array of
(ProgressMode | ProgressDirection)
, I wish typescript was a little smarter.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.
An
as const
seems simple enough: https://www.typescriptlang.org/play/?#code/KYOwrgtgBACgTgewOZ2AZzQWQQE2FAbwCgooAlYABwTgBcBJEPAMwEsRXbgAbATwBoSUAGI0AwmDioQtPgHkwtNLQCGTdkgDqNANaCAvkVCRYiFOjQARVqgDGtVghCEhlhAHcQ3BCpyDSAKqU3r4GRES2TspQAG4q3GDoUAC8UADaRAD0maSkAHoA-EJp8MioGNh4AHQU1HSMLOycPAKmZRbWdg5OVW6eITgAuv7ppeYVuMA1VDQMTMBsHFx8-G3jVjbA9o4gVUEDw8Vj5ViTVaJwElKgsrwKSqrqIFq6q8cdm9s9fV4+QyMlMwnSpTC5XaS3e7KNQ4DTaOB6NYnTpbbq7fZ-Q6DKAqNBQSIgZQAbiIQAThere 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.
Oh cool! I remember using
as const
before but dind't think of this in that scenarioThere 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.
Not a fan of
forEach
as it's not obvious that the callback is called synchronously.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.
actually this function itself doesn't have to be defined as async, would that be okay then?
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.
I'd rather that this was a for-of loop. I personally never use the
forEach
for this reason (that no guarantees are made on how the callback is invoked and this code expects it to be invoked synchronously).