| 3799 | * @category collecting & elements |
| 3800 | */ |
| 3801 | export const all = < |
| 3802 | const Arg extends Iterable<Micro<any, any, any>> | Record<string, Micro<any, any, any>>, |
| 3803 | O extends NoExcessProperties<{ |
| 3804 | readonly concurrency?: Concurrency | undefined |
| 3805 | readonly discard?: boolean | undefined |
| 3806 | }, O> |
| 3807 | >(arg: Arg, options?: O): All.Return<Arg, O> => { |
| 3808 | if (Array.isArray(arg) || isIterable(arg)) { |
| 3809 | return (forEach as any)(arg, identity, options) |
| 3810 | } else if (options?.discard) { |
| 3811 | return (forEach as any)(Object.values(arg), identity, options) |
| 3812 | } |
| 3813 | return suspend(() => { |
| 3814 | const out: Record<string, unknown> = {} |
| 3815 | return as( |
| 3816 | forEach(Object.entries(arg), ([key, effect]) => |
| 3817 | map(effect, (value) => { |
| 3818 | out[key] = value |
| 3819 | }), { |
| 3820 | discard: true, |
| 3821 | concurrency: options?.concurrency |
| 3822 | }), |
| 3823 | out |
| 3824 | ) |
| 3825 | }) as any |
| 3826 | } |
| 3827 | |
| 3828 | /** |
| 3829 | * @since 3.11.0 |