(self: FiberMap<K, A, E>)
| 901 | * **Example** (Running effects as promises) |
| 902 | * |
| 903 | * ```ts import.meta.vitest |
| 904 | * import { Effect, FiberMap } from "effect" |
| 905 | * |
| 906 | * const program = Effect.gen(function*() { |
| 907 | * const map = yield* FiberMap.make<string>() |
| 908 | * const runPromise = yield* FiberMap.runtimePromise(map)<never>() |
| 909 | * |
| 910 | * // Create promises that will be backed by fibers in the map |
| 911 | * const promise1 = runPromise("task1", Effect.succeed("Hello")) |
| 912 | * const promise2 = runPromise("task2", Effect.succeed("World")) |
| 913 | * |
| 914 | * // Convert promises back to Effects and await |
| 915 | * return [yield* Effect.promise(() => promise1), yield* Effect.promise(() => promise2)] |
| 916 | * }) |
| 917 | * |
| 918 | * const actual = await Effect.runPromise(Effect.scoped(program)) |
| 919 | * actual // => ["Hello", "World"] |
| 920 | * ``` |
| 921 | * |
| 922 | * @category combinators |
| 923 | * @since 3.13.0 |
| 924 | */ |
| 925 | export const runtimePromise = <K, A, E>(self: FiberMap<K, A, E>): <R = never>() => Effect.Effect< |
| 926 | <XE extends E, XA extends A>( |
| 927 | key: K, |
| 928 | effect: Effect.Effect<XA, XE, R>, |
| 929 | options?: |
| 930 | | Effect.RunOptions & { |
| 931 | readonly onlyIfMissing?: boolean | undefined |
| 932 | readonly propagateInterruption?: boolean | undefined |
| 933 | } |
| 934 | | undefined |
| 935 | ) => Promise<XA>, |
| 936 | never, |
| 937 | R |
| 938 | > => |
| 939 | <R>() => |
| 940 | Effect.map( |
no test coverage detected
searching dependent graphs…