(reducer: Reducer.Reducer<A>)
| 226 | * @since 4.0.0 |
| 227 | */ |
| 228 | export function makeReducerFailFast<A>(reducer: Reducer.Reducer<A>): Reducer.Reducer<A | undefined> { |
| 229 | const combine = makeCombinerFailFast(reducer).combine |
| 230 | const initialValue = reducer.initialValue as A | undefined |
| 231 | return Reducer.make(combine, initialValue, (collection) => { |
| 232 | let out = initialValue |
| 233 | for (const value of collection) { |
| 234 | out = combine(out, value) |
| 235 | if (out === undefined) return out |
| 236 | } |
| 237 | return out |
| 238 | }) |
| 239 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…