* Resets queries matching the given filters back to their initial state (e.g. any * `initialData`), notifying subscribers rather than removing them. Active queries among the * matched set are then refetched, and the returned promise resolves once that refetch settles. * @param filters - The
(
filters?: QueryFilters<TTaggedQueryKey>,
options?: ResetOptions,
)
| 421 | * ``` |
| 422 | */ |
| 423 | resetQueries<TTaggedQueryKey extends QueryKey = QueryKey>( |
| 424 | filters?: QueryFilters<TTaggedQueryKey>, |
| 425 | options?: ResetOptions, |
| 426 | ): Promise<void> { |
| 427 | const queryCache = this.#queryCache |
| 428 | |
| 429 | return notifyManager.batch(() => { |
| 430 | const matched = queryCache.findAll(filters) |
| 431 | const queriesToRefetch = new Set(matched) |
| 432 | matched.forEach((query) => { |
| 433 | query.reset() |
| 434 | }) |
| 435 | return this.refetchQueries( |
| 436 | { |
| 437 | type: 'active', |
| 438 | predicate: (query) => queriesToRefetch.has(query), |
| 439 | }, |
| 440 | options, |
| 441 | ) |
| 442 | }) |
| 443 | } |
| 444 | |
| 445 | /** |
| 446 | * Cancels outgoing fetches for queries matching the given filters. Most useful when performing |
no test coverage detected