I promise this hook will blow your 10000+ lines of Async code
No pun intended there!
The useAsync() hook which I learned to build from Epic React Workshop by Kent C. Dodds looks like this:
function useSafeDispatch(dispatch) {
const mounted = React.useRef(false)
React.useLayoutEffect(() => {
mounted.cu...
harshkc.hashnode.dev5 min read