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