From 7d6bab81bead1c8274b33b4bd8557a4be7d72155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Valverd=C3=A9?= Date: Fri, 24 Jul 2026 23:07:06 +0200 Subject: [PATCH] Fix ScopeRegistry --- packages/effect-fc-next/src/ScopeRegistry.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/effect-fc-next/src/ScopeRegistry.ts b/packages/effect-fc-next/src/ScopeRegistry.ts index e5307b3..cdd2035 100644 --- a/packages/effect-fc-next/src/ScopeRegistry.ts +++ b/packages/effect-fc-next/src/ScopeRegistry.ts @@ -1,7 +1,11 @@ -import { type Cause, Chunk, Context, DateTime, type Duration, Effect, Equal, Exit, HashMap, Layer, Option, Order, Scope, Semaphore, Stream, SubscriptionRef } from "effect" +import { type Cause, Chunk, Context, DateTime, type Duration, Effect, Equal, Exit, HashMap, Layer, Option, Order, Predicate, Scope, Semaphore, Stream, SubscriptionRef } from "effect" +export const ScopeRegistryServiceTypeId: unique symbol = Symbol.for("@effect-view/ScopeRegistryService/ScopeRegistryService") +export type ScopeRegistryServiceTypeId = typeof ScopeRegistryServiceTypeId + export interface ScopeRegistryService { + readonly [ScopeRegistryServiceTypeId]: ScopeRegistryServiceTypeId readonly ref: SubscriptionRef.SubscriptionRef> register( @@ -30,10 +34,13 @@ export declare namespace ScopeRegistryService { } } +export const isScopeRegistryService = (u: unknown): u is ScopeRegistryService => Predicate.hasProperty(u, ScopeRegistryServiceTypeId) export const makeKey = (): ScopeRegistryService.Key => Equal.byReference({}) export class ScopeRegistryServiceImpl implements ScopeRegistryService { + readonly [ScopeRegistryServiceTypeId]: ScopeRegistryServiceTypeId = ScopeRegistryServiceTypeId + constructor( readonly ref: SubscriptionRef.SubscriptionRef>, readonly runSemaphore: Semaphore.Semaphore,