Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@axios-use/react

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@axios-use/react - npm Package Versions

1

6.1.0

Diff

Changelog

Source

6.1.0 (2022-07-05)

Features

  • feat(useRequest): return all response. (e9317ce)

    interface CreateRequest {
      // Promise function
    - ready: () => Promise<[Payload<TRequest>, AxiosRestResponse]>;
    + ready: () => Promise<[Payload<TRequest>, AxiosResponse]>;
      // Axios Canceler. clear current request.
      cancel: Canceler;
    }
    
    - const [{ data, error, isLoading, other }] = useResource(...)
    + const [{ data, error, isLoading, response }] = useResource(...)
    

No BREAKING CHANGES. Will keep other value, but deprecated.

BREAKING CHANGES

You must update all imports from '@react-cmpt/react-request-hook' to '@axios-use/react'

🚨🚨🚨 Find/replace @react-cmpt/react-request-hook for @axios-use/react and upgrade to v6

Features

  • Customize the Axios instance of the current item. (#10)
    const customIns = axios.create({
      // ...
    });
    
    function Profile({ userId }) {
      const [{ data, error, isLoading }] = useResource(
        (id) => ({ url: `/user/${id}` }),
        [userId],
        { instance: customIns },
      );
    
      // ...
    }
    
  • useResource: requestParams type can be false. (887aabc)

Chore

wangcch
published 6.0.0 •

Changelog

Source

6.1.0 (2022-07-05)

Features

  • feat(useRequest): return all response. (e9317ce)

    interface CreateRequest {
      // Promise function
    - ready: () => Promise<[Payload<TRequest>, AxiosRestResponse]>;
    + ready: () => Promise<[Payload<TRequest>, AxiosResponse]>;
      // Axios Canceler. clear current request.
      cancel: Canceler;
    }
    
    - const [{ data, error, isLoading, other }] = useResource(...)
    + const [{ data, error, isLoading, response }] = useResource(...)
    

No BREAKING CHANGES. Will keep other value, but deprecated.

BREAKING CHANGES

You must update all imports from '@react-cmpt/react-request-hook' to '@axios-use/react'

🚨🚨🚨 Find/replace @react-cmpt/react-request-hook for @axios-use/react and upgrade to v6

Features

  • Customize the Axios instance of the current item. (#10)
    const customIns = axios.create({
      // ...
    });
    
    function Profile({ userId }) {
      const [{ data, error, isLoading }] = useResource(
        (id) => ({ url: `/user/${id}` }),
        [userId],
        { instance: customIns },
      );
    
      // ...
    }
    
  • useResource: requestParams type can be false. (887aabc)

Chore

wangcch
published 6.0.0-alpha.1 •

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc