* Checks whether a query should fetch when an observer mounts: either for its initial load, or * because it has data and `refetchOnMount` asks for a refetch. * @param query - The query to check. * @param options - The observer options. * @returns `true` if the query should fetch on mount.
( query: Query<any, any, any, any>, options: QueryObserverOptions<any, any, any, any, any>, )
| 900 | * @returns `true` if the query should fetch on mount. |
| 901 | */ |
| 902 | function shouldFetchOnMount( |
| 903 | query: Query<any, any, any, any>, |
| 904 | options: QueryObserverOptions<any, any, any, any, any>, |
| 905 | ): boolean { |
| 906 | return ( |
| 907 | shouldLoadOnMount(query, options) || |
| 908 | (query.state.data !== undefined && |
| 909 | shouldFetchOn(query, options, options.refetchOnMount)) |
| 910 | ) |
| 911 | } |
| 912 | |
| 913 | /** |
| 914 | * Checks whether a query should fetch for a `refetchOnMount`, `refetchOnWindowFocus`, or |
no test coverage detected