(
items: Iterable<S1>,
pure: Effect.Effect<A, E, FixEnv<R, Evt, readonly S1[], readonly S2[]>>,
batchSize = 100
)
| 94 | E | InvalidStateError | OptimisticConcurrencyException | DatabaseError, |
| 95 | R | RSchema | RPublish |
| 96 | > { |
| 97 | return Effect.flatMap(gen, ([items, events, a]) => repo.saveAndPublish(items, events).pipe(Effect.map(() => a))) |
| 98 | } |
| 99 | |
| 100 | function saveManyWithPureBatched_< |
| 101 | R, |
| 102 | A, |
| 103 | E, |
| 104 | S1 extends T, |
| 105 | S2 extends T |
| 106 | >( |
| 107 | items: Iterable<S1>, |
| 108 | pure: Effect.Effect<A, E, FixEnv<R, Evt, readonly S1[], readonly S2[]>>, |
| 109 | batchSize = 100 |
| 110 | ) { |
| 111 | return Effect.forEach( |
| 112 | Array.chunksOf(items, batchSize), |
| 113 | (batch) => |
| 114 | saveAllWithEffectInt( |
| 115 | runTerm(pure, batch) |
| 116 | ) |
| 117 | ) |
no test coverage detected
searching dependent graphs…