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

[Bug] Cause.reduceWithContext #639

Closed
nandin-borjigin opened this issue Aug 30, 2023 · 2 comments · Fixed by Effect-TS/stream#164
Closed

[Bug] Cause.reduceWithContext #639

nandin-borjigin opened this issue Aug 30, 2023 · 2 comments · Fixed by Effect-TS/stream#164

Comments

@nandin-borjigin
Copy link

nandin-borjigin commented Aug 30, 2023

import { Duration, Effect, Stream, pipe } from "effect";

pipe(
  Stream.tick(Duration.decode(1000)),
  Stream.runForEach(Effect.log),
  Effect.runPromise
);
Error: BUG: Cause.reduceWithContext - please report an issue at https://github.com/Effect-TS/io/issues
@nandin-borjigin nandin-borjigin changed the title [Bug] [Bug] Cause.reduceWithContext Aug 30, 2023
@nandin-borjigin
Copy link
Author

nandin-borjigin commented Aug 30, 2023

pipe(
  Stream.tick(Duration.decode(1000)),
-  Stream.runForEach(Effect.log),
+  Stream.runForEach((x) => Effect.log(x)),
  Effect.runPromise
);

Resolves the issue.
May need some documentation for this caveat.

@fubhy
Copy link
Member

fubhy commented Aug 30, 2023

This is an issue in @effect/stream. Fix here: Effect-TS/stream#164

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants