* 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. * * @example * `
(
filters?: QueryFilters<TTaggedQueryKey>,
options?: ResetOptions,
)
| 404 | * ``` |
| 405 | */ |
| 406 | resetQueries<TTaggedQueryKey extends QueryKey = QueryKey>( |
| 407 | filters?: QueryFilters<TTaggedQueryKey>, |
| 408 | options?: ResetOptions, |
| 409 | ): Promise<void> { |
| 410 | const queryCache = this.#queryCache |
| 411 | |
| 412 | return notifyManager.batch(() => { |
| 413 | const matched = queryCache.findAll(filters) |
| 414 | const queriesToRefetch = new Set(matched) |
| 415 | matched.forEach((query) => { |
| 416 | query.reset() |
| 417 | }) |
| 418 | return this.refetchQueries( |
| 419 | { |
| 420 | type: 'active', |
| 421 | predicate: (query) => queriesToRefetch.has(query), |
| 422 | }, |
| 423 | options, |
| 424 | ) |
| 425 | }) |
| 426 | } |
| 427 | |
| 428 | /** |
| 429 | * Cancels outgoing fetches for queries matching the given filters. Most useful when performing |
no test coverage detected