File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,9 @@ const {
4343 notifyOnChangeProps ,
4444 placeholderData ,
4545 queryKeyHashFn ,
46+ onSuccess ,
47+ onError ,
48+ onSettled ,
4649 refetchInterval ,
4750 refetchIntervalInBackground ,
4851 refetchOnMount ,
@@ -106,6 +109,18 @@ const {
106109- ` queryKeyHashFn: (queryKey: QueryKey) => string `
107110 - Optional
108111 - If specified, this function is used to hash the ` queryKey ` to a string.
112+ - ` onSuccess: (data: TData | undefined) => Promise<unknown> | unknown `
113+ - Optional
114+ - This function will fire when the ` queryFn ` is successful and will be passed the ` data ` .
115+ - Void function, the returned value will be ignored
116+ - ` onError: (error: TError | null) => Promise<unknown> | unknown `
117+ - Optional
118+ - This function will fire if the ` queryFn ` encounters an error and will be passed the ` error `
119+ - Void function, the returned value will be ignored
120+ - ` onSettled: (data: TData | undefined, error: TError | null) => Promise<unknown> | unknown `
121+ - Optional
122+ - This function will fire when the ` queryFn ` is either successfully fetched or encounters an error and be passed either the ` data ` or ` error `
123+ - Void function, the returned value will be ignored
109124- ` refetchInterval: number | false | ((query: Query) => number | false | undefined) `
110125 - Optional
111126 - If set to a number, all queries will continuously refetch at this frequency in milliseconds
Original file line number Diff line number Diff line change @@ -43,6 +43,9 @@ const {
4343 initialDataUpdatedAt ,
4444 meta ,
4545 queryKeyHashFn ,
46+ onSuccess ,
47+ onError ,
48+ onSettled ,
4649 refetchInterval ,
4750 refetchIntervalInBackground ,
4851 refetchOnMount ,
@@ -244,6 +247,18 @@ function App() {
244247 - ##### ` queryKeyHashFn: (queryKey: QueryKey) => string `
245248 - Optional
246249 - If specified, this function is used to hash the ` queryKey ` to a string.
250+ - ##### ` onSuccess: (data: TData | undefined) => Promise<unknown> | unknown `
251+ - Optional
252+ - This function will fire when the ` queryFn ` is successful and will be passed the ` data ` .
253+ - Void function, the returned value will be ignored
254+ - ##### ` onError: (error: TError | null) => Promise<unknown> | unknown `
255+ - Optional
256+ - This function will fire if the ` queryFn ` encounters an error and will be passed the ` error `
257+ - Void function, the returned value will be ignored
258+ - ##### ` onSettled: (data: TData | undefined, error: TError | null) => Promise<unknown> | unknown `
259+ - Optional
260+ - This function will fire when the ` queryFn ` is either successfully fetched or encounters an error and be passed either the ` data ` or ` error `
261+ - Void function, the returned value will be ignored
247262 - ##### ` refetchInterval: number | false | ((query: Query) => number | false | undefined) `
248263 - Optional
249264 - If set to a number, all queries will continuously refetch at this frequency in milliseconds
You can’t perform that action at this time.
0 commit comments