Closed as not planned
Description
Hey 👋,
Currently, the hooks system (onSeattled
, onSuccess
) is only available when using onMutation
but having it for useQuery
could be very useful.
For example, if I want to start and finish the Nuxt loading indocator, I have to use a watcher on the asyncStatus
props.
const { asyncStatus } = useQuery(...)
const { start, finish } = useLoadingIndicator()
watch(asyncStatus, (status) => {
if (status === 'loading') {
start()
} else {
finish()
}
})
It could be more convenient to have this directly in the useQuery
to make sure that everything is tight.
For example:
const { start, finish } = useLoadingIndicator()
const {} = useQuery({
onQuery: () => start()
onSettled: () => finish()
})
Metadata
Metadata
Assignees
Labels
No labels
Projects
Status
Done