Skip to content

Instantly share code, notes, and snippets.

View schichulin's full-sized avatar

Serhii Chychulin schichulin

  • Smartling, Inc.
  • Lviv, Ukraine
View GitHub Profile
function useAbortController() {
const abortControllerRef = React.useRef()
const getAbortController = React.useCallback(() => {
if (!abortControllerRef.current) {
abortControllerRef.current = new AbortController()
}
return abortControllerRef.current
}, [])
React.useEffect(() => {