(notifyOptions?: NotifyOptions)
| 658 | } |
| 659 | |
| 660 | updateResult(notifyOptions?: NotifyOptions): void { |
| 661 | const prevResult = this.currentResult as |
| 662 | | QueryObserverResult<TData, TError> |
| 663 | | undefined |
| 664 | |
| 665 | this.currentResult = this.createResult(this.currentQuery, this.options) |
| 666 | this.currentResultState = this.currentQuery.state |
| 667 | this.currentResultOptions = this.options |
| 668 | |
| 669 | // Only notify if something has changed |
| 670 | if (shallowEqualObjects(this.currentResult, prevResult)) { |
| 671 | return |
| 672 | } |
| 673 | |
| 674 | // Determine which callbacks to trigger |
| 675 | const defaultNotifyOptions: NotifyOptions = { cache: true } |
| 676 | |
| 677 | if ( |
| 678 | notifyOptions?.listeners !== false && |
| 679 | this.shouldNotifyListeners(this.currentResult, prevResult) |
| 680 | ) { |
| 681 | defaultNotifyOptions.listeners = true |
| 682 | } |
| 683 | |
| 684 | this.notify({ ...defaultNotifyOptions, ...notifyOptions }) |
| 685 | } |
| 686 | |
| 687 | private updateQuery(): void { |
| 688 | const query = this.client |
no test coverage detected