Skip to content

refactor: extract formatTimeAgo to shared utils#285

Closed
wdeveloper16 wants to merge 1 commit intoentrius:testfrom
wdeveloper16:refactor/extract-format-time-ago
Closed

refactor: extract formatTimeAgo to shared utils#285
wdeveloper16 wants to merge 1 commit intoentrius:testfrom
wdeveloper16:refactor/extract-format-time-ago

Conversation

@wdeveloper16
Copy link
Copy Markdown
Contributor

@wdeveloper16 wdeveloper16 commented Apr 15, 2026

Summary

Net: 17 lines removed from component, 13 lines added to shared util.

Test plan

  • npm run format:check — passes
  • npm run lint — passes (0 warnings)
  • npm run build — clean build, no TS errors
  • MinerScoreCard "Updated X ago" chip still renders correctly

@wdeveloper16
Copy link
Copy Markdown
Contributor Author

Extracts the locally-defined formatTimeAgo from MinerScoreCard.tsx into src/utils/format.ts, completing the pattern started by #214 and #215.

@wdeveloper16
Copy link
Copy Markdown
Contributor Author

Would be it possible to review by you, @anderdc ?

@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented Apr 15, 2026

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.

@anderdc anderdc closed this Apr 15, 2026
@anderdc anderdc added the refactor Code restructuring without behavior change label Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code restructuring without behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants