Skip to content

Releases: axios-use/axios-use-react

6.6.0

10 Mar 15:35
Compare
Choose a tag to compare

Features

  • useRequest: getResponseItem option (#22)
    use getResponseItem function to custom returns the value of data.

6.5.0

21 Oct 04:36
Compare
Choose a tag to compare

Features

  • request: export _request to custom response type (#21)

6.4.2

04 May 03:17
Compare
Choose a tag to compare

Features

  • refactor(cache-key): replace with object-code to generate cache key. (#20)

6.4.1

23 Apr 05:39
Compare
Choose a tag to compare

Bug Fixes

  • type: onCompleted response generic error. (aed68bf)

6.4.0

26 Mar 14:55
Compare
Choose a tag to compare

Bug Fixes

  • createRequestError: value num 0. (84a3084)

Features

  • cache: use ttl cache by default. (#19)

  • onCompleted types: parameters is required. (96f1f8d)

  • CData type: replace CData width BodyData. (5f26f42)

    No BREAKING CHANGES. Will keep CData type, but deprecated.

6.3.0

05 Dec 14:43
Compare
Choose a tag to compare

Bug Fixes

  • useResource: catch fnOptions undefined error. (bd74a59)

Chore

  • Upgrade devDependencies. (axios v1 #17)

6.2.0

23 Aug 02:38
Compare
Choose a tag to compare

Bug Fixes

  • types: ready return type (RequestFactory). (1407056)

Features

  • useResource: return refresh func. (f6e7692)
    - const [reqState, fetch] = useResource();
    + const [reqState, fetch, refresh] = useResource();

6.1.0

05 Jul 02:39
Compare
Choose a tag to compare

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.

6.0.0

15 May 02:35
Compare
Choose a tag to compare

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

5.1.0

13 Feb 07:48
Compare
Choose a tag to compare

Features

  • RequestProvider: RequestProvider is optional. You can use useRequest, useResource directly. (afd0e40)