diff --git a/packages/effect-fc/src/Query.ts b/packages/effect-fc/src/Query.ts index fd869e0..4429b31 100644 --- a/packages/effect-fc/src/Query.ts +++ b/packages/effect-fc/src/Query.ts @@ -106,12 +106,11 @@ export const service = ( self: Query -): Effect.Effect => Stream.runForEach(self.key, key => - (self as QueryImpl).interrupt.pipe( - Effect.andThen(SubscriptionRef.set((self as QueryImpl).latestKey, Option.some(key))), - Effect.andThen((self as QueryImpl).start(key)), - Effect.andThen(sub => Effect.forkScoped( - (self as QueryImpl).watch(sub) - )), - ) -) +): Effect.Effect => { + const _self = self as QueryImpl + return Stream.runForEach(_self.key, key => _self.interrupt.pipe( + Effect.andThen(SubscriptionRef.set(_self.latestKey, Option.some(key))), + Effect.andThen(_self.start(key)), + Effect.andThen(sub => Effect.forkScoped(_self.watch(sub))), + )) +}