MCPcopy Index your code
hub / github.com/anomalyco/opencode / noUpdate

Function noUpdate

packages/core/test/filesystem/watcher.test.ts:122–133  ·  view source on GitHub ↗
(check: (event: WatcherEvent) => boolean, trigger: Effect.Effect<void, E>, timeout = 500)

Source from the content-addressed store, hash-verified

120}
121
122function noUpdate<E>(check: (event: WatcherEvent) => boolean, trigger: Effect.Effect<void, E>, timeout = 500) {
123 return Effect.acquireUseRelease(
124 wait(check),
125 ({ deferred }) =>
126 trigger.pipe(
127 Effect.andThen(Deferred.await(deferred)),
128 Effect.timeoutOption(`${timeout} millis`),
129 Effect.tap((result) => Effect.sync(() => expect(result).toEqual(Option.none()))),
130 ),
131 ({ fiber }) => Fiber.interrupt(fiber),
132 )
133}
134
135function ready(directory: string) {
136 const file = path.join(directory, `.watcher-${Math.random().toString(36).slice(2)}`)

Callers 1

watcher.test.tsFile · 0.85

Calls 3

syncMethod · 0.80
interruptMethod · 0.80
waitFunction · 0.70

Tested by

no test coverage detected