The problem with Promises is they don’t support cancellation. There’s AbortController for fetch, but it’s super awkward to use and browser support could be better. Anything beyond a POC that hits endpoints should abort pending requests whose results are no longer required. Observable is a better fit than Promise because it supports cancellation of the underlying resource when unsubscribing.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The problem with
Promise
s is they don’t support cancellation. There’sAbortController
forfetch
, but it’s super awkward to use and browser support could be better. Anything beyond a POC that hits endpoints should abort pending requests whose results are no longer required.Observable
is a better fit thanPromise
because it supports cancellation of the underlying resource when unsubscribing.