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

core(simulator): clearer intermediate timing types #11744

Merged
merged 2 commits into from
Dec 7, 2020

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.

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