Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

queries.js

25 lines612 Bytes

1import axios from 'axios'
2​
3// let count = 0;
4​
5export async function fetchProjects(key) {
6 console.info('fetch projects')
7 // if (count < 4) {
8 // count++;
9 // throw new Error("testing");
10 // }
11 let { data } = await axios.get(
12 `https://api.github.com/users/tannerlinsley/repos?sort=updated`,
13 )
14 await new Promise((r) => setTimeout(r, 1000))
15 return data
17​
18export async function fetchProject(id) {
19 console.info('fetch project id', id)
20 let { data } = await axios.get(
21 `https://api.github.com/repos/tannerlinsley/${id}`,
22 )
23 await new Promise((r) => setTimeout(r, 1000))
24 return data