diff --git a/packages/effect-fc/src/Component.ts b/packages/effect-fc/src/Component.ts index f7d1881..9536427 100644 --- a/packages/effect-fc/src/Component.ts +++ b/packages/effect-fc/src/Component.ts @@ -405,15 +405,15 @@ export const withRuntime: { }) -export class ComponentScopeMap extends Effect.Service()("effect-fc/Component/ComponentScopeMap", { +export class ScopeMap extends Effect.Service()("effect-fc/Component/ScopeMap", { effect: Effect.bind( Effect.Do, "ref", - () => Ref.make(HashMap.empty()), + () => Ref.make(HashMap.empty()), ), }) {} -export namespace ComponentScopeMap { +export namespace ScopeMap { export interface Entry { readonly scope: Scope.CloseableScope readonly closeFiber: Option.Option> @@ -432,7 +432,7 @@ export const useScope: { runtimeRef.current = yield* Effect.runtime() const key = React.useId() - const scopeMap = yield* ComponentScopeMap as unknown as Effect.Effect + const scopeMap = yield* ScopeMap as unknown as Effect.Effect const scope = React.useMemo(() => Runtime.runSync(runtimeRef.current)(Effect.andThen( scopeMap.ref, diff --git a/packages/effect-fc/src/ReactRuntime.ts b/packages/effect-fc/src/ReactRuntime.ts index 5e46ab6..2b1bc01 100644 --- a/packages/effect-fc/src/ReactRuntime.ts +++ b/packages/effect-fc/src/ReactRuntime.ts @@ -22,10 +22,10 @@ export const isReactRuntime = (u: unknown): u is ReactRuntime export const make = ( layer: Layer.Layer, memoMap?: Layer.MemoMap, -): ReactRuntime => Object.setPrototypeOf( +): ReactRuntime => Object.setPrototypeOf( Object.assign(function() {}, { runtime: ManagedRuntime.make( - Layer.merge(layer, Component.ComponentScopeMap.Default), + Layer.merge(layer, Component.ScopeMap.Default), memoMap, ), // biome-ignore lint/style/noNonNullAssertion: context initialization