import { ReloadableInternal } from "@effect/core/io/Reloadable/operations/_internal/ReloadableInternal" /** * Makes a new reloadable service from a layer that describes the construction * of a static service. * * @tsplus static effect/core/io/Reloadable.Ops manual */ export function manual( outTag: Tag, layer: Layer ): Layer> { return Layer.scoped( outTag.reloadable, Do(($) => { const input = $(Effect.environment()) const ref = $(ScopedRef.fromAcquire(layer.build.map((env) => env.unsafeGet(outTag)))) const reload = ref.set(layer.build.map((env) => env.unsafeGet(outTag))) .provideEnvironment(input) return new ReloadableInternal(ref, reload) }) ) }