fix(core): tolerate minimal FSWatcher typings (#35264)
This commit is contained in:
parent
35ed09ff37
commit
e2faeb84e5
1 changed files with 5 additions and 3 deletions
|
|
@ -89,9 +89,11 @@ const layer = Layer.effect(
|
||||||
type: "update",
|
type: "update",
|
||||||
} satisfies Update)
|
} satisfies Update)
|
||||||
})
|
})
|
||||||
subscription.on("error", (error) =>
|
if ("on" in subscription && typeof subscription.on === "function") {
|
||||||
Effect.runFork(Effect.logError("watcher callback failed", { path: target, error })),
|
subscription.on("error", (error: unknown) =>
|
||||||
)
|
Effect.runFork(Effect.logError("watcher callback failed", { path: target, error })),
|
||||||
|
)
|
||||||
|
}
|
||||||
return { unsubscribe: () => Promise.resolve(subscription.close()) }
|
return { unsubscribe: () => Promise.resolve(subscription.close()) }
|
||||||
})
|
})
|
||||||
: subscribeDirectory(native, backend, directory, ignore, pubsub)
|
: subscribeDirectory(native, backend, directory, ignore, pubsub)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue