Effect CommunityEC
Effect Community•3y ago•
6 replies
Frederic

Creating a Runtime from a List of Layers

Hi experts,
I would like a generic function to make a runtime from a list of layers. Something like:
const makeRuntimeFromLayers = (layerList: ???) => {
  const scope = Effect.runSync(Scope.make())
  const myRuntime = await Layer.toRuntime (layerList).pipe(
    Effect.provideService(Scope.Scope, scope),
    Effect.runPromise,
  )
  return myRuntime
}

What should the layerList type be ? It's going too deep into abstract territories .. I can't wrap my head around 🙂
Was this page helpful?