Best Practices for Creating Parameterized ManagedRuntime in Effect
Hello Effect folks,
I need to create a parameterized runtime, that is I need to supply
ManagedRuntime
ManagedRuntime
with initial data.
I am comfortable using
ManagedRuntime
ManagedRuntime
in the traditional sense as a module singleton, e.g.
// runtime.tsimport * as ManagedRuntime from 'effect/ManagedRuntime'rexport const runtime = ManagedRuntime.make(...)// consumer.tsimport { runtime } from './runtime.js'runtime.runPromiseExit(...)
// runtime.tsimport * as ManagedRuntime from 'effect/ManagedRuntime'rexport const runtime = ManagedRuntime.make(...)// consumer.tsimport { runtime } from './runtime.js'runtime.runPromiseExit(...)
But if I were instead to need
// runtime.tsimport * as ManagedRuntime from 'effect/ManagedRuntime'export const runtime = (x: ...) => ManagedRuntime.make(...)
// runtime.tsimport * as ManagedRuntime from 'effect/ManagedRuntime'export const runtime = (x: ...) => ManagedRuntime.make(...)
is there a known best practice for this scenario? Ultimately the input will be satisfying layer creation for a simple static context and determining log-level upon initialization.
Edit: This is a React boundary use case, but the runtime could be consumed by multiple layers. I could use a mutable