Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
fix Effect.forEach usage (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
fubhy authored Aug 30, 2023
1 parent c83aaf8 commit d031d7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/internal/sink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ export const contramapEffect = dual<
self,
(chunk) =>
Effect.map(
Effect.forEach(chunk, f),
Effect.forEach(chunk, (v) => f(v)),
Chunk.unsafeFromArray
)
)
Expand Down Expand Up @@ -1375,7 +1375,7 @@ export const flatMap = dual<
export const forEach = <In, R, E, _>(f: (input: In) => Effect.Effect<R, E, _>): Sink.Sink<R, E, In, never, void> => {
const process: Channel.Channel<R, E, Chunk.Chunk<In>, unknown, E, never, void> = core.readWithCause({
onInput: (input: Chunk.Chunk<In>) =>
pipe(core.fromEffect(Effect.forEach(input, f, { discard: true })), core.flatMap(() => process)),
pipe(core.fromEffect(Effect.forEach(input, (v) => f(v), { discard: true })), core.flatMap(() => process)),
onFailure: core.failCause,
onDone: () => core.unit
})
Expand Down

0 comments on commit d031d7f

Please sign in to comment.