use-abort-controller-hook
v1.0.2
Published
React AbortController Hook
Downloads
194
Readme
use-abort-controller
AbortController hook
Install
npm install --save use-abort-controller-hook
Usage
import { useAbortController } from "use-abort-controller-hook";
const App = () => {
const abortController = useAbortController();
useEffect(() => {
fetch("https://www.npmjs.com/package/use-abort-controller-hook", {
signal: abortController.signal,
});
return () => {
abortController.abort();
};
}, [abortController]);
return <div>Abort</div>;
};
License
MIT © marcoSven