MCPcopy Index your code
hub / github.com/Effect-TS/effect / all

Function all

packages/effect/src/internal/fiberRuntime.ts:1966–1993  ·  view source on GitHub ↗
(
  arg: Arg,
  options?: O
)

Source from the content-addressed store, hash-verified

1964
1965/* @internal */
1966export const all = <
1967 const Arg extends Iterable<Effect.Effect<any, any, any>> | Record<string, Effect.Effect<any, any, any>>,
1968 O extends NoExcessProperties<{
1969 readonly concurrency?: Concurrency | undefined
1970 readonly batching?: boolean | "inherit" | undefined
1971 readonly discard?: boolean | undefined
1972 readonly mode?: "default" | "validate" | "either" | undefined
1973 readonly concurrentFinalizers?: boolean | undefined
1974 }, O>
1975>(
1976 arg: Arg,
1977 options?: O
1978): Effect.All.Return<Arg, O> => {
1979 const [effects, reconcile] = allResolveInput(arg)
1980
1981 if (options?.mode === "validate") {
1982 return allValidate(effects, reconcile, options) as any
1983 } else if (options?.mode === "either") {
1984 return allEither(effects, reconcile, options) as any
1985 }
1986
1987 return options?.discard !== true && reconcile._tag === "Some"
1988 ? core.map(
1989 forEach(effects, identity, options as any),
1990 reconcile.value
1991 ) as any
1992 : forEach(effects, identity, options as any) as any
1993}
1994
1995/* @internal */
1996export const allWith = <

Callers 3

allWithFunction · 0.70
allSuccessesFunction · 0.70
fiberRuntime.tsFile · 0.70

Calls 5

allResolveInputFunction · 0.85
allValidateFunction · 0.85
allEitherFunction · 0.85
forEachFunction · 0.70
mapMethod · 0.65

Tested by

no test coverage detected