1st push
This commit is contained in:
parent
501d8a8d8e
commit
3226975910
76 changed files with 48623 additions and 3401 deletions
33
datafetch/datafetch.js
Normal file
33
datafetch/datafetch.js
Normal 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,
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue