You've already forked pages
forked from didirus/AstralRinth
* Initial bug fixes * fix compile error on non-mac * Fix even more bugs * Fix more * fix more * fix build * fix build * address review comments
12 lines
266 B
JavaScript
12 lines
266 B
JavaScript
import { ofetch } from 'ofetch'
|
|
import { handleError } from '@/store/state.js'
|
|
|
|
export const useFetch = async (url, item) => {
|
|
try {
|
|
return await ofetch(url)
|
|
} catch (err) {
|
|
handleError({ message: `Error fetching ${item}` })
|
|
console.error(err)
|
|
}
|
|
}
|