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