Gathering detailed insights and metrics for use-rq-fetcher
Gathering detailed insights and metrics for use-rq-fetcher
Gathering detailed insights and metrics for use-rq-fetcher
Gathering detailed insights and metrics for use-rq-fetcher
npm install use-rq-fetcher
Typescript
Module System
Node Version
NPM Version
59.4
Supply Chain
87.1
Quality
82
Maintenance
100
Vulnerability
100
License
TypeScript (100%)
Total Downloads
964
Last Day
1
Last Week
2
Last Month
22
Last Year
964
19 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Jan 27, 2025
Minified
Minified + Gzipped
Latest Version
1.0.12
Package Id
use-rq-fetcher@1.0.12
Unpacked Size
9.88 kB
Size
2.85 kB
File Count
5
NPM Version
10.2.4
Node Version
20.11.1
Published on
Jan 27, 2025
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
-50%
2
Compared to previous week
Last Month
-35.3%
22
Compared to previous month
Last Year
0%
964
Compared to previous year
4
6
A custom React Query fetcher hook for dynamic Axios integrations.
npm install use-rq-fetcher
yarn add use-rq-fetcher
useQuery
.you must install this packajes ! برای استفاده از این هوک ، مطمئن شوید موارد زیر در پروژه شما نصب است
1@tanstack/react-query: >=5.64.2 2react: >=19.0.0 3typescript: >=5.7.3 4axios: >=1.7.9
1import React from "react"; 2import { useRQFetcher } from "use-rq-fetcher"; 3import axios from "axios"; 4import API from "@/utils/interceptor"; // from your axios instance in interceptor 5 6interface MyResponseType { 7 name : string 8} 9 10const MyComponent = () => { 11 const { data, isLoading, error } = useRQFetcher<commonresponse<MyResponseType>, commonresponse>({ 12 API, 13 url: "/endpoint", 14 queryKey: ["example-data"], 15 params: { page: "example number like 1" , limit: "example number like 10" }, 16 }); 17 18 if (isLoading) return <div>Loading...</div>; 19 if (error) return <div>Error occurred: {error.message}</div>; 20 21 return <div>Data: {data?.name}</div>; 22}; 23 24export default MyComponent;
Parameter | Type | Default | Description |
---|---|---|---|
API | AxiosInstance | Required | An Axios instance for making HTTP requests. |
baseURL | string | your damain | Base URL for the API, used if provided. |
url | string | Required | The endpoint URL for the request. |
queryKey | `Array<string | number>` | Required |
headers | AxiosHeaders or object | {} | Additional headers for the request. |
params | object | {} | Query parameters to append to the URL. |
pathParams | object | {} | Path parameters to replace placeholders in the URL. |
...rest | UseQueryOptions<TData, TError> | N/A | Additional options for the useQuery hook from React Query. |
This project is licensed under the MIT License. See the LICENSE file for more details.
[1.0.12] - Initial Release : اطلاعات مربوط به تغییرات ارائه شده در اخرین نسخه هوک :
No vulnerabilities found.
No security vulnerabilities found.