Skip to content

Commit

Permalink
[effect] document zipLeft and zipRight (#2223)
Browse files Browse the repository at this point in the history
  • Loading branch information
Schniz authored Feb 29, 2024
1 parent 6f503b7 commit 0a37676
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/nine-months-suffer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"effect": patch
---

document Effect.zipLeft and Effect.zipRight
32 changes: 32 additions & 0 deletions packages/effect/src/Effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4775,6 +4775,22 @@ export const zip: {
} = fiberRuntime.zipOptions

/**
* Sequentially run this effect with the specified effect, _discarding_ the result
* of the second effect (`that`) in the chain.
*
* `{ concurrent: true }` can be passed to the options to make it a concurrent execution
* of both effects instead of sequential.
*
* @example
*
* import { Effect } from 'effect';
*
* const effect = Effect.succeed("a message").pipe(
* Effect.zipLeft(Effect.succeed(42)),
* )
*
* assert.deepStrictEqual(Effect.runSync(effect), "a message");
*
* @since 2.0.0
* @category zipping
*/
Expand All @@ -4795,6 +4811,22 @@ export const zipLeft: {
} = fiberRuntime.zipLeftOptions

/**
* Sequentially run this effect with the specified effect, _returning_ the result
* of the second effect (`that`) in the chain.
*
* `{ concurrent: true ]` can be passed to the options to make it a concurrent execution
* of both effects instead of sequential.
*
* @example
*
* import { Effect } from 'effect';
*
* const effect = Effect.succeed("a message").pipe(
* Effect.zipRight(Effect.succeed(42)),
* )
*
* assert.deepStrictEqual(Effect.runSync(effect), 42);
*
* @since 2.0.0
* @category zipping
*/
Expand Down

0 comments on commit 0a37676

Please sign in to comment.