DEV Community

Discussion on: Clean Up Async Requests in `useEffect` Hooks

Collapse
 
pallymore profile image
Yurui Zhang

Thanks - yes that's possible - however in that case the AbortController instance basically acts like a boolean flag. 😅

it can be helpful in certain scenarios though. if you are working with a lot of Promises - I'd recommend checking out npmjs.com/package/cancelable-promise

Collapse
 
paulrberg profile image
Paul Razvan Berg

Whoah, that library looks like just what I was looking for. Thanks!