* `setFocused` can be used to manually set the focus state. Set `undefined` * to fall back to the default focus check. * @param focused - The focus state, or `undefined` to use the default focus check. * @example * ```ts * import { focusManager } from '@tanstack/query-core' * *
(focused?: boolean)
| 106 | * ``` |
| 107 | */ |
| 108 | setFocused(focused?: boolean): void { |
| 109 | const changed = this.#focused !== focused |
| 110 | if (changed) { |
| 111 | this.#focused = focused |
| 112 | this.onFocus() |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | /** |
| 117 | * `onFocus` notifies all subscribed listeners with the current focus state. |
no test coverage detected