refactor(core): unify live event subscriptions

This commit is contained in:
Kit Langton 2026-07-06 13:40:19 -04:00
commit 142ce54e72
4 changed files with 15 additions and 19 deletions

View file

@ -177,7 +177,7 @@ describe("EventV2", () => {
Effect.gen(function* () {
const events = yield* EventV2.Service
const typed = yield* events.subscribe(Message).pipe(Stream.take(1), Stream.runCollect, Effect.forkScoped)
const wildcard = yield* events.live().pipe(Stream.take(1), Stream.runCollect, Effect.forkScoped)
const wildcard = yield* events.subscribe().pipe(Stream.take(1), Stream.runCollect, Effect.forkScoped)
yield* Effect.yieldNow
const event = yield* events.publish(Message, { text: "hello" })
@ -258,7 +258,7 @@ describe("EventV2", () => {
Effect.gen(function* () {
const events = yield* EventV2.Service
const received = new Array<string>()
const fiber = yield* events.live().pipe(
const fiber = yield* events.subscribe().pipe(
Stream.take(1),
Stream.runForEach(() => Effect.sync(() => received.push("stream"))),
Effect.forkScoped,

View file

@ -27,7 +27,6 @@ const capture = () => {
return event
}),
subscribe: () => Stream.empty,
live: () => Stream.empty,
log: () => Stream.empty,
sequences: () => Effect.succeed(new Map()),
listen: () => Effect.succeed(Effect.void),