Skip to content

Commit

Permalink
Fix Stream.scoped example (#4176)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikearnaldi authored Dec 20, 2024
1 parent 0c91dd6 commit 39457d4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/mean-rules-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"effect": patch
---

Fix Stream.scoped example
11 changes: 6 additions & 5 deletions packages/effect/src/Stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4582,11 +4582,12 @@ export const scheduleWith: {
*
* // Creating a single-valued stream from a scoped resource
* const stream = Stream.scoped(
* Effect.acquireUseRelease(
* Console.log("acquire"),
* () => Console.log("use"),
* () => Console.log("release")
* )
* Effect.acquireRelease(
* Console.log("acquire"),
* () => Console.log("release")
* )
* ).pipe(
* Stream.flatMap(() => Console.log("use"))
* )
*
* // Effect.runPromise(Stream.runCollect(stream)).then(console.log)
Expand Down

0 comments on commit 39457d4

Please sign in to comment.