const { date } = useDateRange() // date: Ref<{ start: Date; end: Date }>
const { data, pending, error } = await useFetch<T>('/api/any', {
query: {
started_after: computed(() => date.value.start.toISOString()),
finished_before: computed(() => date.value.end.toISOString()),
},
})
// periodically reassign the whole object (simulates a single user action)
useTimeoutPoll(() => {
date.value = { start: new Date(), end: new Date() }
}, 1000)
const { date } = useDateRange() // date: Ref<{ start: Date; end: Date }>
const { data, pending, error } = await useFetch<T>('/api/any', {
query: {
started_after: computed(() => date.value.start.toISOString()),
finished_before: computed(() => date.value.end.toISOString()),
},
})
// periodically reassign the whole object (simulates a single user action)
useTimeoutPoll(() => {
date.value = { start: new Date(), end: new Date() }
}, 1000)