Using Effects in a Callback Function: Stumped on How to Yield Effects
Currently using effect in a semi-serious application for the first time and I've reached a point where I'm genuinely stumped.
I've got an external function
I ended up writing this code, which simply
(Note:
I've got an external function
foo that expects a parameter/callback of type (bar: Bar) => void and I want to use Effects in this callback. I'm calling foo inside an Effect.gen generator, so I'm assuming it's possible somehow to use effects here, but I can't figure out how to yield* effects inside the callback without changing the type of the callback function to an Effect itself (which I can't do, because I don't control the type that foo expects).I ended up writing this code, which simply
runs the effect that I want to use inside the callback, but I feel like there has to be some better way? (Note:
processJSDocComment returns an Effect)