(fn: () => Promise<T> | T)
| 46 | * Mirrors `Effect.promise` but restores workspace ALS first. |
| 47 | */ |
| 48 | export 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 | |
| 54 | export function make(): Effect.Effect<Shape> { |
| 55 | return Effect.gen(function* () { |
nothing calls this directly
no test coverage detected