Skip to content

Conversation

@patrickhulce
Copy link
Collaborator

Summary
@connorjclark I'm requesting your feedback here since you brought this up :)

There were many ways this could be done, but this felt like a decent balance between duplication in the right places, reading clarity, and type safety. I expect others might have different ideas of the tradeoffs though :)

Related Issues/PRs
fixes #11692

Copy link
Collaborator

@connorjclark connorjclark left a comment

Choose a reason for hiding this comment

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

seems good to me.

I experimented with using a type predicate fn, but it didn't look like the slight deduplication it'd offer is worth it
image

I had some trouble separating all of these new functions from the actual meat of the class. Maybe all of these could be pulled into a new NodeTimings class?

* @property {number} [timeElapsed]
* @property {number} [timeElapsedOvershoot]
* @property {number} [bytesDownloaded]
* @typedef NodeTimingComplete
Copy link
Collaborator

Choose a reason for hiding this comment

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

IMO typedefs at the top of the file is a better place.

@patrickhulce patrickhulce merged commit 9aad172 into master Dec 7, 2020
@patrickhulce patrickhulce deleted the lantern_timing_types branch December 7, 2020 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lantern simulator type improvements

3 participants