@ventlio/tanstack-query 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.js +1 -1
- package/dist/index.mjs +2 -2
- package/dist/request/axios-instance.js +2 -1
- package/dist/request/axios-instance.js.map +1 -1
- package/package.json +1 -1
- package/src/constants/index.ts +1 -1
- package/src/request/axios-instance.ts +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const API_BASE_URL = "";
|
|
1
|
+
export declare const API_BASE_URL = "https://pokeapi.co/api/v2";
|
package/dist/constants/index.js
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { useQuery, useMutation } from '@tanstack/react-query';
|
|
|
2
2
|
import { useState, startTransition } from 'react';
|
|
3
3
|
import axios from 'axios';
|
|
4
4
|
|
|
5
|
-
const API_BASE_URL = '';
|
|
5
|
+
const API_BASE_URL = 'https://pokeapi.co/api/v2';
|
|
6
6
|
|
|
7
7
|
const scrollToTop = () => {
|
|
8
8
|
window.scrollTo({
|
|
@@ -13,7 +13,7 @@ const scrollToTop = () => {
|
|
|
13
13
|
|
|
14
14
|
const axiosInstance = (headers) => {
|
|
15
15
|
return axios.create({
|
|
16
|
-
baseURL:
|
|
16
|
+
baseURL: API_BASE_URL,
|
|
17
17
|
timeout: 100000,
|
|
18
18
|
headers,
|
|
19
19
|
});
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var axios = require('axios');
|
|
4
|
+
var index = require('../constants/index.js');
|
|
4
5
|
|
|
5
6
|
const axiosInstance = (headers) => {
|
|
6
7
|
return axios.create({
|
|
7
|
-
baseURL:
|
|
8
|
+
baseURL: index.API_BASE_URL,
|
|
8
9
|
timeout: 100000,
|
|
9
10
|
headers,
|
|
10
11
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axios-instance.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"axios-instance.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
package/src/constants/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const API_BASE_URL = '';
|
|
1
|
+
export const API_BASE_URL = 'https://pokeapi.co/api/v2';
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { AxiosInstance, RawAxiosRequestHeaders } from 'axios';
|
|
2
2
|
import axios from 'axios';
|
|
3
|
+
import { API_BASE_URL } from '../constants';
|
|
3
4
|
|
|
4
5
|
export const axiosInstance = (
|
|
5
6
|
headers: RawAxiosRequestHeaders
|
|
6
7
|
): AxiosInstance => {
|
|
7
8
|
return axios.create({
|
|
8
|
-
baseURL:
|
|
9
|
+
baseURL: API_BASE_URL,
|
|
9
10
|
timeout: 100000,
|
|
10
11
|
headers,
|
|
11
12
|
});
|