We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e0a3792 commit 23097c3Copy full SHA for 23097c3
src/guide/reusability/composables.md
@@ -216,19 +216,19 @@ export function useFetch(url) {
216
const data = ref(null)
217
const error = ref(null)
218
219
- const fetchData = (dt) => {
+ const fetchData = () => {
220
// reset state before fetching..
221
data.value = null
222
error.value = null
223
224
- fetch(toValue(dt))
+ fetch(toValue(url))
225
.then((res) => res.json())
226
.then((json) => (data.value = json))
227
.catch((err) => (error.value = err))
228
}
229
230
watchEffect(() => {
231
- fetchData(url)
+ fetchData()
232
})
233
234
return { data, error }
0 commit comments