MCPcopy Create free account
hub / github.com/Effect-TS/effect / makeReducer

Function makeReducer

packages/effect/src/Tuple.ts:716–725  ·  view source on GitHub ↗
(
  reducers: { readonly [K in keyof A]: Reducer.Reducer<A[K]> }
)

Source from the content-addressed store, hash-verified

714 * @since 4.0.0
715 */
716export function makeReducer<A extends ReadonlyArray<unknown>>(
717 reducers: { readonly [K in keyof A]: Reducer.Reducer<A[K]> }
718): Reducer.Reducer<A> {
719 const combine = makeCombiner(reducers).combine
720 const initialValue = []
721 for (let i = 0; i < reducers.length; i++) {
722 initialValue.push(reducers[i].initialValue)
723 }
724 return Reducer.make(combine, initialValue as unknown as A)
725}

Callers

nothing calls this directly

Calls 3

pushMethod · 0.80
makeCombinerFunction · 0.70
makeMethod · 0.65

Tested by

no test coverage detected