Though that can be done, it will never return true since whenever the signal will be aborted, the code would enter the catch block because of the exception thrown.
MERN Stack Developer & Certified Neo4j Professional with over 5 years of experience. Love to learn and build new things. When not coding, you can find me exploring new tech, games & books.
Great post, didn't knew about the AbortController, just learned cool stuff, thanks!
Just one small correction, I think that in the cleanup function of the AbortController example, you want to call abortController.abort().
Additionally, you can check the status of the abort signal before doing any state-changing assignments.
Though that can be done, it will never return true since whenever the signal will be aborted, the code would enter the catch block because of the exception thrown.
yes, I was thinking the same.
Thanks, that was a typo and I have updated it.