This commit is contained in:
Rahul 2024-02-29 09:33:34 +01:00
parent 501d8a8d8e
commit 3226975910
76 changed files with 48623 additions and 3401 deletions

33
datafetch/datafetch.js Normal file
View file

@ -0,0 +1,33 @@
import useSWR from "swr"
const fetcher = (...args) => fetch(...args).then((res) => res.json())
export function menuitemfetcher(url) {
const { data, error, isLoading } = useSWR("https://jsonplaceholder.typicode.com/posts", fetcher)
return {
data: data,
isLoading,
isError: error,
}
}
export function learningitemfetcher(url) {
const { data, error, isLoading } = useSWR("https://jsonplaceholder.typicode.com/posts", fetcher)
return {
data: data,
isLoading,
isError: error,
}
}
export function learningpodfetcher() {
const { data, error, isLoading } = useSWR("https://jsonplaceholder.typicode.com/posts", fetcher)
return {
data: data,
isLoading,
isError: error,
}
}