Post

Sometimes I want to interrupt an async function that doesn't support abort signals. In situations without side-effects, here's a wrapper to abort a promise and lazily discard its result. I generally prefer safer interruption patterns (as in #Effect-TS) but it's handy in a pinch.

mattrossman.comNaive promise interruption

0 reposts0 likes

No replies yet.