MCPcopy Create free account
hub / github.com/anomalyco/opencode / waitForState

Function waitForState

packages/opencode/test/effect/runner.test.ts:6–9  ·  view source on GitHub ↗
(runner: Runner.Runner<A, E>, tag: Runner.State<A, E>["_tag"])

Source from the content-addressed store, hash-verified

4import { it } from "../lib/effect"
5
6const waitForState = <A, E>(runner: Runner.Runner<A, E>, tag: Runner.State<A, E>["_tag"]) =>
7 Effect.gen(function* () {
8 while (runner.state._tag !== tag) yield* Effect.yieldNow
9 }).pipe(Effect.timeout("1 second"))
10
11describe("Runner", () => {
12 // --- ensureRunning semantics ---

Callers 1

runner.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected