MCPcopy Create free account
hub / github.com/TanStack/query / onFocus

Method onFocus

packages/query-core/src/focusManager.ts:119–124  ·  view source on GitHub ↗

* `onFocus` notifies all subscribed listeners with the current focus state.

()

Source from the content-addressed store, hash-verified

117 * `onFocus` notifies all subscribed listeners with the current focus state.
118 */
119 onFocus(): void {
120 const isFocused = this.isFocused()
121 this.listeners.forEach((listener) => {
122 listener(isFocused)
123 })
124 }
125
126 /**
127 * `isFocused` can be used to get the current focus state.

Callers 2

setEventListenerMethod · 0.95
setFocusedMethod · 0.95

Calls 2

isFocusedMethod · 0.95
listenerFunction · 0.50

Tested by

no test coverage detected