Skip to content

[URH-48] useGeolocation 신규 #45

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

Merged
merged 1 commit into from
Aug 21, 2024
Merged

[URH-48] useGeolocation 신규 #45

merged 1 commit into from
Aug 21, 2024

Conversation

Choozii
Copy link
Member

@Choozii Choozii commented Aug 10, 2024

👾 Pull Request

  • 상태: 신규

1️⃣ Spec

  • 현재 유저의 지리적 위치 값 리턴, 위치 불러오기 중인지 로딩 여부, 에러값 리턴
  • device 위치가 변경될 때마다 호출되도록 watchPosition() 사용

2️⃣ 변경 사항

3️⃣ 예시 코드

const { coords, timestamp, error, loading } = useGeolocation();

  if(loading){
  return <p>loading...</p>
  }

  if(error){
  return <p>{error.message}</p>
  }

  return (
    <div>
          <p>Latitude: {coords.latitude}</p>
          <p>Longitude: {coords.longitude}</p>
          <p>Altitude: {coords.altitude}</p>
          <p>Timestamp: {new Date(timestamp).toLocaleString()}</p>
    </div>
  );

4️⃣ 관련 문서 (선택 사항)

@Choozii Choozii self-assigned this Aug 10, 2024
@Choozii Choozii requested a review from suhyeoonn August 10, 2024 03:30
@bicochan bicochan self-requested a review August 12, 2024 11:37
Copy link
Collaborator

@foresec foresec left a comment

Choose a reason for hiding this comment

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

수고하셨습니다👍 늦게나마 코드리뷰 남겨봐요😂

Copy link
Contributor

@suhyeoonn suhyeoonn left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!!🥳

Copy link
Member

@bicochan bicochan left a comment

Choose a reason for hiding this comment

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

👍🏻✨

Copy link
Collaborator

@foresec foresec left a comment

Choose a reason for hiding this comment

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

승인을 잊고 있었네요 수고하셨습니다😊

✨ feat: 테스트 코드 추가

✨ feat: options default valude 추가, isMount 생성

✨ feat: handleReset 추가

✨ feat: return type 변경
@Choozii Choozii force-pushed the URH-48/use-geolocation branch from dbff65f to 56d0d62 Compare August 21, 2024 14:23
@Choozii Choozii merged commit 74ff439 into master Aug 21, 2024
@Choozii Choozii deleted the URH-48/use-geolocation branch August 21, 2024 14:24
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.

4 participants