fix: preserve bus instance context (#28051)

This commit is contained in:
Dax
2026-05-17 12:56:42 -04:00
committed by GitHub
parent 5060577ee1
commit 23b594de6e
8 changed files with 37 additions and 49 deletions
+4 -4
View File
@@ -96,11 +96,11 @@ export const layer = Layer.effect(
)
const cb: ParcelWatcher.SubscribeCallback = bridge.bind((err, evts) => {
if (err) return
// if (err) return
for (const evt of evts) {
if (evt.type === "create") void Bus.publish(Event.Updated, { file: evt.path, event: "add" })
if (evt.type === "update") void Bus.publish(Event.Updated, { file: evt.path, event: "change" })
if (evt.type === "delete") void Bus.publish(Event.Updated, { file: evt.path, event: "unlink" })
if (evt.type === "create") void Bus.publish(ctx, Event.Updated, { file: evt.path, event: "add" })
if (evt.type === "update") void Bus.publish(ctx, Event.Updated, { file: evt.path, event: "change" })
if (evt.type === "delete") void Bus.publish(ctx, Event.Updated, { file: evt.path, event: "unlink" })
}
})