Skip to content

3.0.0

Compare
Choose a tag to compare
@wangcch wangcch released this 03 Jan 09:04
· 128 commits to main since this release

Features

  • useRequest: swap returns (7169e9e)
    // before
    const [request, createRequest] = useRequest(...);
    // now
    const [createRequest, request] = useRequest(...);
  • return other responses (3924e0c)
    const [createRequest] = useRequest(...);
    
    const fetch = async () => {
      // before
      const response = await createRequest.ready();
    
      // now. [T, Omit<AxiosResponse<T>, "data">]
      const [response, otherAxiosReponse] = await createRequest.ready();
    }
    // before
    const [{ data, error, isLoading, cancel }] = useResource(...);
    
    // now. other: Omit<AxiosResponse, "data">
    const [{ data, other, error, isLoading, cancel }] = useResource(...);