@galactushouse/galactus-hook
v1.4.0
Published
Ready-to-use hook library
Downloads
7
Maintainers
Readme
About
The galactus-hook
library has a collection of ready-to-use hooks that will help you with your project tasks, in addition to making your code clean and with many fast features.
Install
Install the galactus-hook
library:
npm install @galactushouse/galactus-hook
or
yarn add @galactushouse/galactus-hook
Usage
Import one or more hooks chosen from the library into your component and use them as needed for your project:
import { useLocalStorage } from '@galactushouse/galactus-hook'
Hooks documentation
Access the specific documentation for each hook to learn more about its features:
Hooks details
| Hook | Functions / Variables | Description |
| --- | --- | --- |
| useApi
| getRequest
postRequest
putRequest
patchRequest
deleteRequest
| Hook with quick and easy functionality for full API consumption. The useApi hook works with the GET, POST, PUT, PATCH and DELETE methods. |
| useCookie
| getCookie
setCookie
deleteCookie
| Hook with quick and easy functionality to manage cookies for your web applications. |
| useLocalStorage
| addLocalStorage
editLocalStorage
readLocalStorage
removeLocalStorage
| Hook with quick and easy functionality to create, edit, access and remove information in the browser's local storage. |
| useLocation
| getLocation
setLocation
| Hook with quick and easy functionality for accessing window.location, giving you full possibilities of reading and changing its properties, generating navigation autonomy for your web application. |
| useWindowScroll
| positionX
positionY
| Hook with quick and easy functionality to access the horizontal and vertical position of the scroll in your application. |
Contribute
To contribute to the galactus-hook
project follow the steps mentioned below:
- Fork the
galactus-hook
project. - Clone the project (forked by you).
- Make changes, create new hooks or documentation (In case you create a new hook, you must also create the documentation of its features in the README.md file in your folder).
- Record your change in the CHANGELOG.md file following the standardization.
- Submit your Pull Request (PR) containing your changes.
Licensed
GalactusHook is MIT licensed.