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

queries.js

19 lines525 Bytes

1import axios from "axios";
2​
3export async function fetchProjects(key) {
4 console.info("fetch projects");
5 let { data } = await axios.get(
6 `https://api.github.com/users/tannerlinsley/repos?sort=updated`
7 );
8 await new Promise(r => setTimeout(r, 1000));
9 return data;
11​
12export async function fetchProject(key, { id }) {
13 console.info("fetch project id", id);
14 let { data } = await axios.get(
15 `https://api.github.com/repos/tannerlinsley/${id}`
16 );
17 await new Promise(r => setTimeout(r, 1000));
18 return data;