()
| 227 | } |
| 228 | |
| 229 | private syncClient(): boolean { |
| 230 | const nextClient = this.tryGetQueryClient() |
| 231 | if (!nextClient) { |
| 232 | this.unsubscribeObserver() |
| 233 | this.queryClient = undefined |
| 234 | this.observer = undefined |
| 235 | this.resultTracker.reset() |
| 236 | this.setResult(createPendingQueryResult()) |
| 237 | return false |
| 238 | } |
| 239 | |
| 240 | if (nextClient === this.queryClient && this.observer) { |
| 241 | return true |
| 242 | } |
| 243 | |
| 244 | this.unsubscribeObserver() |
| 245 | this.queryClient = nextClient |
| 246 | const options = this.defaultOptions() |
| 247 | this.observer = new QueryObserver(this.queryClient, options) |
| 248 | this.setObserverResult(this.observer.getOptimisticResult(options)) |
| 249 | return true |
| 250 | } |
| 251 | |
| 252 | private applyOptions(): boolean { |
| 253 | if (!this.syncClient() || !this.observer) { |
no test coverage detected