The solution presented here isn't really "cancellation", because (as the article acknowledges), the async..await function (aka, the generator) isn't stopped right away, but only silently exits later after it eventually resumes (if ever).
A better approach, IMO, is to proactively stop the generator (using its return() or throw() methods) right away.
CAF is a library I wrote to make such truyly-cancelable async functions easy to write and work with: github.com/getify/CAF
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 solution presented here isn't really "cancellation", because (as the article acknowledges), the async..await function (aka, the generator) isn't stopped right away, but only silently exits later after it eventually resumes (if ever).
A better approach, IMO, is to proactively stop the generator (using its return() or throw() methods) right away.
CAF is a library I wrote to make such truyly-cancelable async functions easy to write and work with: github.com/getify/CAF