by vbezhenar · 3y ago · 0 comments
Here's my implementation, for the record: https://pastebin.com/rjj0FDDd
Even after years of writing fullstack javascript this is my first time seeing AbortSignals, probably because nobody uses them. Some libraries, like Axios, handroll their own cancellation mechanisms, but that does not really cut it.
This implementation doesn't account for the fact that the promise may settle after the component has been unmounted.