© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
Adding onInterrupt to Current Effect Using Yield - Effect Community
EC
Effect Community
•
3y ago
•
36 replies
jessekelly
Adding onInterrupt to Current Effect Using Yield
Is there any way to add an onInterrupt to the current effect using yield
? I
.e
. I know you can pipe it at the end but I need to reference a var created w
/in the gen block in the cleanup fn
.
Effect.
gen
(
function*
(
_
) {
yield*
_
(Effect.
onInterrupt
(()
=>
...
))
})
Effect.
gen
(
function*
(
_
) {
yield*
_
(Effect.
onInterrupt
(()
=>
...
))
})
Effect Community
Join
Production-grade applications in TypeScript.
6,221
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
Inquiry About Adding Effect-Atom to Effect-Smol Repo
EC
Effect Community / 🚀-effect
3mo ago
here is anyone using `yield x ` where
EC
Effect Community / 🚀-effect
4y ago
Testing if Effects have been yielded using effect/vitest
EC
Effect Community / 🚀-effect
15mo ago
Merging `EffectGen`'s Iterator into `Effect` Prototype to Simplify `yield*` Syntax
EC
Effect Community / 🚀-effect
3y ago