useFetch() and watch reactivity
I got a lack of reactivity on a useLazyFetch call:
How come my manual watch() works but the reactive sources in
// lazy fetching, but doesn't refresh automatically on its reactive sources from query part
const { refresh } = useLazyFetch(
() => `/api/*********`,
{
query: {
id: destination.id, // ref
dateDebut: startDate, // computed
dateFin: endDate, // computed
lang: locale, // ref
},
immediate: false,
// either I input watchers manually or not here, doesn't trigger when sources change
watch: [destination.id, dateFin, locale],
},
)
// but adding my own watchers work
watch(
() => [destination.id.value, dateRange.value.end, locale.value],
() => {
refresh()
},
)// lazy fetching, but doesn't refresh automatically on its reactive sources from query part
const { refresh } = useLazyFetch(
() => `/api/*********`,
{
query: {
id: destination.id, // ref
dateDebut: startDate, // computed
dateFin: endDate, // computed
lang: locale, // ref
},
immediate: false,
// either I input watchers manually or not here, doesn't trigger when sources change
watch: [destination.id, dateFin, locale],
},
)
// but adding my own watchers work
watch(
() => [destination.id.value, dateRange.value.end, locale.value],
() => {
refresh()
},
)How come my manual watch() works but the reactive sources in
queryquery won't trigger another fetching?