(
options?: QueryOptions<TQueryFnData, TError, TData, TQueryKey>,
)
| 201 | } |
| 202 | |
| 203 | setOptions( |
| 204 | options?: QueryOptions<TQueryFnData, TError, TData, TQueryKey>, |
| 205 | ): void { |
| 206 | this.options = { ...this.#defaultOptions, ...options } |
| 207 | |
| 208 | if (options?._type) { |
| 209 | this.#queryType = options._type |
| 210 | } |
| 211 | |
| 212 | this.updateGcTime(this.options.gcTime) |
| 213 | |
| 214 | // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition |
| 215 | if (this.state && this.state.data === undefined) { |
| 216 | const defaultState = getDefaultState(this.options) |
| 217 | if (defaultState.data !== undefined) { |
| 218 | this.setState( |
| 219 | successState(defaultState.data, defaultState.dataUpdatedAt), |
| 220 | ) |
| 221 | this.#initialState = defaultState |
| 222 | } |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | protected optionalRemove() { |
| 227 | if (!this.observers.length && this.state.fetchStatus === 'idle') { |
no test coverage detected