MCPcopy
hub / github.com/adobe/react-spectrum / cleanup

Function cleanup

packages/react-aria/src/interactions/utils.ts:178–186  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

176 window.addEventListener('focus', onFocus, true);
177
178 let cleanup = () => {
179 cancelAnimationFrame(raf);
180 window.removeEventListener('blur', onBlur, true);
181 window.removeEventListener('focusout', onFocusOut, true);
182 window.removeEventListener('focusin', onFocusIn, true);
183 window.removeEventListener('focus', onFocus, true);
184 ignoreFocusEvent = false;
185 isRefocusing = false;
186 };
187
188 let raf = requestAnimationFrame(cleanup);
189 return cleanup;

Callers 9

onFocusOutFunction · 0.85
onFocusInFunction · 0.85
mergeRefsFunction · 0.85
Provider.test.tsxFile · 0.85

Calls 1

removeEventListenerMethod · 0.80

Tested by

no test coverage detected