Packages

effect

4.1.4 · 11 Nov 2026MIT66.6M / weekRepositoryHomepagenpmAtom feed

Your version

3.7.0

30 Aug 2024Where it was published

3.22.5 is the newest release of 3.x.

In short

9 new1 fixed

Security

2 advisories affect 3.7.0; 3.22.1 fixes them

Release note

Minor Changes

  • Preserve Array.modify Array.modifyOption non emptiness

  • improve: Type Fiber.awaitAll as Exit<A, E>.

  • New constructor Config.nonEmptyString

  • Preserve Array.replace Array.replaceOption non emptiness

  • Add Effect.bindAll api

    This api allows you to combine Effect.all with Effect.bind. It is useful
    when you want to concurrently run multiple effects and then combine their
    results in a Do notation pipeline.

    import { Effect } from "effect"
    
    const result = Effect.Do.pipe(
      Effect.bind("x", () => Effect.succeed(2)),
      Effect.bindAll(
        ({ x }) => ({
          a: Effect.succeed(x + 1),
          b: Effect.succeed("foo")
        }),
        { concurrency: 2 }
      )
    )
    assert.deepStrictEqual(Effect.runSync(result), {
      x: 2,
      a: 3,
      b: "foo"
    })
  • Add propagateInterruption option to Fiber{Handle,Set,Map}

    This option will send any external interrupts to the .join result.

  • Stream: Implement race operator, which accepts two upstreams and returns a stream that mirrors the first upstream to emit an item and interrupts the other upstream.

    import { Stream, Schedule, Console, Effect } from "effect"
    
    const stream = Stream.fromSchedule(Schedule.spaced("2 millis")).pipe(
      Stream.race(Stream.fromSchedule(Schedule.spaced("1 millis"))),
      Stream.take(6),
      Stream.tap((n) => Console.log(n))
    )
    
    Effect.runPromise(Stream.runDrain(stream))
    // Output each millisecond from the first stream, the rest streams are interrupted
    // 0
    // 1
    // 2
    // 3
    // 4
    // 5
  • Avoid automatic propagation of finalizer concurrency, closes #3440

  • Add Context.getOrElse api, for gettings a Tag's value with a fallback

Patch Changes

  • Add Micro.isMicroCause guard

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.