effectify Bus service: migrate to Effect PubSub + InstanceState (#18579)

This commit is contained in:
Kit Langton
2026-03-25 20:19:24 -04:00
committed by GitHub
parent b90de755f9
commit 97c15a087d
42 changed files with 1113 additions and 522 deletions

View File

@@ -110,10 +110,16 @@ describe("SyncEvent", () => {
type: string
properties: { id: string; name: string }
}> = []
const unsub = Bus.subscribeAll((event) => events.push(event))
const received = new Promise<void>((resolve) => {
Bus.subscribeAll((event) => {
events.push(event)
resolve()
})
})
SyncEvent.run(Created, { id: "evt_1", name: "test" })
await received
expect(events).toHaveLength(1)
expect(events[0]).toEqual({
type: "item.created",
@@ -122,8 +128,6 @@ describe("SyncEvent", () => {
name: "test",
},
})
unsub()
}),
)
})