0.0.3 • Published 1 year ago

user-location-address v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

user-location-address

GitHub npm

Installation

npm i user-location-address

or

yarn add user-location-address

Usage

This hook returns the userLocation, latitude, longitude, isLoading, userClickToGetLocation. This hook also includes the insertion of the user's city, state and country in Local Storage.

import { useUserLocation } from "user-location-address";

return (

  const { userClickToGetLocation, userLocation, isLoading } = useUserLocation();

  // Passing data as properties to a button component.
  <LocationButton
    onClick={userClickToGetLocation}
    userLocation={userLocation}
    isLoading={isLoading}
  />
);

Hook return

NameTypeDescription
userLocationobjectUser address return
latitudenumberUser's latitude
longitudenumberUser's longitude
isLoadingbooleanData loading process
userClickToGetLocationfuncExecutes the data return call

License

The files included in this repository are licensed under the MIT license.

Contributions

Feel free to open an issue or add a pull request. Anytime. Really, I mean it.

0.0.3

1 year ago

3.0.0

1 year ago

2.0.0

1 year ago