Fix
All checks were successful
Lint / lint (push) Successful in 12s

This commit is contained in:
Julien Valverdé
2025-10-23 10:49:00 +02:00
parent b39c5946f9
commit bb0579408d
2 changed files with 6 additions and 6 deletions

View File

@@ -405,15 +405,15 @@ export const withRuntime: {
}) })
export class ComponentScopeMap extends Effect.Service<ComponentScopeMap>()("effect-fc/Component/ComponentScopeMap", { export class ScopeMap extends Effect.Service<ScopeMap>()("effect-fc/Component/ScopeMap", {
effect: Effect.bind( effect: Effect.bind(
Effect.Do, Effect.Do,
"ref", "ref",
() => Ref.make(HashMap.empty<string, ComponentScopeMap.Entry>()), () => Ref.make(HashMap.empty<string, ScopeMap.Entry>()),
), ),
}) {} }) {}
export namespace ComponentScopeMap { export namespace ScopeMap {
export interface Entry { export interface Entry {
readonly scope: Scope.CloseableScope readonly scope: Scope.CloseableScope
readonly closeFiber: Option.Option<Fiber.RuntimeFiber<void>> readonly closeFiber: Option.Option<Fiber.RuntimeFiber<void>>
@@ -432,7 +432,7 @@ export const useScope: {
runtimeRef.current = yield* Effect.runtime() runtimeRef.current = yield* Effect.runtime()
const key = React.useId() const key = React.useId()
const scopeMap = yield* ComponentScopeMap as unknown as Effect.Effect<ComponentScopeMap> const scopeMap = yield* ScopeMap as unknown as Effect.Effect<ScopeMap>
const scope = React.useMemo(() => Runtime.runSync(runtimeRef.current)(Effect.andThen( const scope = React.useMemo(() => Runtime.runSync(runtimeRef.current)(Effect.andThen(
scopeMap.ref, scopeMap.ref,

View File

@@ -22,10 +22,10 @@ export const isReactRuntime = (u: unknown): u is ReactRuntime<unknown, unknown>
export const make = <R, ER>( export const make = <R, ER>(
layer: Layer.Layer<R, ER>, layer: Layer.Layer<R, ER>,
memoMap?: Layer.MemoMap, memoMap?: Layer.MemoMap,
): ReactRuntime<R | Component.ComponentScopeMap, ER> => Object.setPrototypeOf( ): ReactRuntime<R | Component.ScopeMap, ER> => Object.setPrototypeOf(
Object.assign(function() {}, { Object.assign(function() {}, {
runtime: ManagedRuntime.make( runtime: ManagedRuntime.make(
Layer.merge(layer, Component.ComponentScopeMap.Default), Layer.merge(layer, Component.ScopeMap.Default),
memoMap, memoMap,
), ),
// biome-ignore lint/style/noNonNullAssertion: context initialization // biome-ignore lint/style/noNonNullAssertion: context initialization