Skip to content

Conversation

@Yongveloper
Copy link
Contributor

Overview

A new useGeolocation hook that wraps the browser's Geolocation API. Provides a simple interface for accessing and tracking the user's location.

Checklist

  • Did you write the test code?
  • Have you run yarn run fix to format and lint the code and docs?
  • Have you run yarn run test:coverage to make sure there is no uncovered line?
  • Did you write the JSDoc?

Copilot AI review requested due to automatic review settings May 20, 2025 02:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new useGeolocation hook that wraps the browser's Geolocation API to provide a simple and unified interface for retrieving and tracking the user's location.

  • Added a new hook implementation with customizable mount behaviors for one-time location fetch or continuous tracking.
  • Provided comprehensive tests for different usage scenarios and error handling.
  • Updated the module export to include useGeolocation in the public API.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/index.ts Exports the new useGeolocation hook.
src/hooks/useGeolocation/useGeolocation.ts Implements the hook with error handling, tracking functions, and corresponding options.
src/hooks/useGeolocation/useGeolocation.spec.ts Adds comprehensive tests covering location fetching, error handling, automatic behaviors, and state updates.
src/hooks/useGeolocation/index.ts Re-exports the hook for better module organization.

@Yongveloper Yongveloper changed the title feat(useGeolocation): add useGeolocation hook feat(hooks): add useGeolocation hook May 20, 2025
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (29f547d) to head (449c0ef).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##              main      #238    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           34        35     +1     
  Lines          865       988   +123     
  Branches       265       301    +36     
==========================================
+ Hits           865       988   +123     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@seungrodotlee seungrodotlee left a comment

Choose a reason for hiding this comment

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

Thanks! 👍

@seungrodotlee seungrodotlee merged commit d6cbe07 into toss:main Jun 1, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants