New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

useful-hook

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

useful-hook

Useful

latest
Source
npmnpm
Version
0.1.3
Version published
Weekly downloads
1
-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

Useful hooks

A pack of some useful hooks which include several utility hooks. Feel free to generate a PR in case you want to increase the methodology

AXIOS Hooks

Currently this package has 2 hooks for axios which are useAxios and useActionAxios

useAxios - GET APIs Only

to use the useAxios hook you can pass url and refetch following is the sample of how you can use it

  const {
    error,
    isLoading,
    result,
    isSuccess,
  } = useAxios(API_URL, config, refetch); // refetch can be a state variable and increment or decrement it if you want to refetch from the API

useActionAxios - GET APIs Only

  const {
    error,
    isLoading,
    result,
    isSuccess,
    dispatch: dispatcher,
  } = useActionAxios(API_URL, config); // call dispatcher whenever you want to make API call like button click etc

Thanks.

Keywords

axios hooks

FAQs

Package last updated on 03 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts