|
Download react-query/docs/reference/QueryObserver.md from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 438 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/docs/reference/QueryObserver.md
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/docs/reference/QueryObserver.md
-
curl -L -o QueryObserver.md https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/docs/reference/QueryObserver.md
438 Bytes
metadata
id: QueryObserver
title: QueryObserver
The QueryObserver can be used to observe and switch between queries.
const observer = new QueryObserver(queryClient, { queryKey: ['posts'] })
const unsubscribe = observer.subscribe((result) => {
console.log(result)
unsubscribe()
})
Options
The options for the QueryObserver are exactly the same as those of useQuery.