Debugging Effect Integration with React
I am absolutely shattered. I've spent the entire day trying to debug why I get
I'm passing around a
I would pass around the constructed
I then later consume with the following eye-watering pattern:
(note, this is abridged. But theres nothing interesting I omitted)
and the resulting effect is then passed to an
This is heavily inspired by @Tim Smarts work, modified (or more aptly, broken) by yours truly.
TL;DR:
runtime is perma closed, meaning all my scoped effects, even if manually scoped, break with service not found.
cause="All fibers interrupted without errors." on all my Effect.logs. I'm trying to integration effect with react. I am never in the entire lifespan of the app ever ever close a scope. I even stuck finalizers on the lone scope I do have to shout at me if I accidentally close it.I'm passing around a
Effect<never, E, Runtime<R>>, the Scope attached to this effect is manually controlled and never closed. I provide it using Effect.provideService(Scope, scope) because I know Effect.scoped and Scope.use and similar have termination triggers.I would pass around the constructed
Runtime<R> but it's constructed async so I pass around an Effect.cached version of the effect that would yield it.I then later consume with the following eye-watering pattern:
(note, this is abridged. But theres nothing interesting I omitted)
and the resulting effect is then passed to an
Effect.runCallback to sync it to my react state, theres also a similar clone of the interruption model on that level as well.This is heavily inspired by @Tim Smarts work, modified (or more aptly, broken) by yours truly.
TL;DR:
effect -> runtime -> used in callback -> run with callbackruntime is perma closed, meaning all my scoped effects, even if manually scoped, break with service not found.
