(notifyOptions: NotifyOptions)
| 729 | } |
| 730 | |
| 731 | private notify(notifyOptions: NotifyOptions): void { |
| 732 | notifyManager.batch(() => { |
| 733 | // First trigger the configuration callbacks |
| 734 | if (notifyOptions.onSuccess) { |
| 735 | this.options.onSuccess?.(this.currentResult.data!) |
| 736 | this.options.onSettled?.(this.currentResult.data!, null) |
| 737 | } else if (notifyOptions.onError) { |
| 738 | this.options.onError?.(this.currentResult.error!) |
| 739 | this.options.onSettled?.(undefined, this.currentResult.error!) |
| 740 | } |
| 741 | |
| 742 | // Then trigger the listeners |
| 743 | if (notifyOptions.listeners) { |
| 744 | this.listeners.forEach(listener => { |
| 745 | listener(this.currentResult) |
| 746 | }) |
| 747 | } |
| 748 | |
| 749 | // Then the cache listeners |
| 750 | if (notifyOptions.cache) { |
| 751 | this.client |
| 752 | .getQueryCache() |
| 753 | .notify({ query: this.currentQuery, type: 'observerResultsUpdated' }) |
| 754 | } |
| 755 | }) |
| 756 | } |
| 757 | } |
| 758 | |
| 759 | function shouldLoadOnMount( |
no test coverage detected