refactor: extract formatTimeAgo to shared utils#285
Closed
wdeveloper16 wants to merge 1 commit intoentrius:testfrom
Closed
refactor: extract formatTimeAgo to shared utils#285wdeveloper16 wants to merge 1 commit intoentrius:testfrom
wdeveloper16 wants to merge 1 commit intoentrius:testfrom
Conversation
Contributor
Author
Contributor
Author
|
Would be it possible to review by you, @anderdc ? |
Collaborator
|
Closing — formatTimeAgo has a single caller. Extracting it to a shared util adds a module and an import for no reuse benefit. The abstraction cost outweighs the duplication when there's only one call site. |
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.
Summary
formatTimeAgoout ofMinerScoreCard.tsxintosrc/utils/format.tsMinerScoreCard.tsxto use the shared utilityformatDate(refactor: Extract duplicated formatDate to shared utils #214) andcredibilityColor(refactor: Extract duplicated credibilityColor to shared utils #215)Net: 17 lines removed from component, 13 lines added to shared util.
Test plan
npm run format:check— passesnpm run lint— passes (0 warnings)npm run build— clean build, no TS errors