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

Function fromPromise

packages/opencode/src/effect/bridge.ts:48–52  ·  view source on GitHub ↗
(fn: () => Promise<T> | T)

Source from the content-addressed store, hash-verified

46 * Mirrors `Effect.promise` but restores workspace ALS first.
47 */
48export const fromPromise = <T>(fn: () => Promise<T> | T): Effect.Effect<T> =>
49 Effect.gen(function* () {
50 const workspace = yield* WorkspaceRef
51 return yield* Effect.promise(() => Promise.resolve(restoreWorkspace(workspace, () => fn())))
52 })
53
54export function make(): Effect.Effect<Shape> {
55 return Effect.gen(function* () {

Callers

nothing calls this directly

Calls 2

restoreWorkspaceFunction · 0.85
fnFunction · 0.50

Tested by

no test coverage detected