mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
ec31473f8f
Remove IE11 polyfills and update browser support policy GitOrigin-RevId: 9ab9513ecf97fc565a1d2620f9785a64bd16b766
13 lines
266 B
JavaScript
13 lines
266 B
JavaScript
import { useEffect, useState } from 'react'
|
|
|
|
export default function useAbortController() {
|
|
const [controller] = useState(() => new AbortController())
|
|
|
|
useEffect(() => {
|
|
return () => {
|
|
controller.abort()
|
|
}
|
|
}, [controller])
|
|
|
|
return controller
|
|
}
|