docs(api): add watch parameter in useFetch options (#5562)

Co-authored-by: 井上裕貴 <inoueyuki@inoueyukinoMacBook-Pro.local>
This commit is contained in:
Yuki Inoue 2022-06-22 19:41:34 +09:00 committed by GitHub
parent de3b4084a5
commit 1b6289f60f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,6 +22,7 @@ type UseFetchOptions = {
default?: () => DataT
transform?: (input: DataT) => DataT
pick?: string[]
watch?: WatchSource[]
}
type DataT = {
@ -47,6 +48,7 @@ type DataT = {
* `server`: Whether to fetch the data on the server (defaults to `true`).
* `default`: A factory function to set the default value of the data, before the async function resolves - particularly useful with the `lazy: true` option.
* `pick`: Only pick specified keys in this array from the `handler` function result.
* `watch`: watch reactive sources to auto-refresh
* `transform`: A function that can be used to alter `handler` function result after resolving.
## Return values