Promise cannot be cancelled, it is the process that returns promise must be cancellable.
For example, XmlHttpRequest is cancellable as it has an abort method.
Fetch api also supports AbortController.signal, that is cancellable.
As Promises are deeply nested, and promise is a result, it cannot be cancelled and even if somehow you ignore by putting timeout, underlying process will not be cancelled.
Hey !! I am a Enthusiast Web developer on my way to explore all inches of web and connect with people. Dont hesitate to reach out to me.
Linkedin: https://in.linkedin.com/in/rautrohit
Hi akash i know we cannot cancel the network call but can u tell me how to not perform the action which was suppose to be performed when promise would have resolved?
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.
Promise cannot be cancelled, it is the process that returns promise must be cancellable.
For example, XmlHttpRequest is cancellable as it has an abort method.
Fetch api also supports AbortController.signal, that is cancellable.
As Promises are deeply nested, and promise is a result, it cannot be cancelled and even if somehow you ignore by putting timeout, underlying process will not be cancelled.
Hi akash i know we cannot cancel the network call but can u tell me how to not perform the action which was suppose to be performed when promise would have resolved?