DEV Community

Discussion on: Cancellable async functions in JavaScript

jayfranko2 profile image
Jay Franko • Edited

Great post!! For my 10 line function approach #2 suffices, but the final solution will sure come in handy some day!

By the way: in my case the barrier check is in a deeper nested function. I throw an error instead of a simple return. That way I can suffice with only a single barrier check instead of 5.