github Effect-TS/effect effect@3.12.10

Patch Changes

  • #4412 e30f132 Thanks @KhraksMamtsov! - Fix STM unification

  • #4403 33fa667 Thanks @gcanti! - Duration: fix format output when the input is zero.

    Before

    import { Duration } from "effect"
    
    console.log(Duration.format(Duration.zero))
    // Output: ""

    After

    import { Duration } from "effect"
    
    console.log(Duration.format(Duration.zero))
    // Output: "0"
  • #4411 87f5f28 Thanks @gcanti! - Enhance TagClass and ReferenceClass to enforce key type narrowing, closes #4409.

    The key property in TagClass and ReferenceClass now correctly retains its specific string value, just like in Effect.Service

    import { Context, Effect } from "effect"
    
    // -------------------------------------------------------------------------------------
    // `key` field
    // -------------------------------------------------------------------------------------
    
    class A extends Effect.Service<A>()("A", { succeed: { a: "value" } }) {}
    
    // $ExpectType "A"
    A.key
    
    class B extends Context.Tag("B")<B, { a: "value" }>() {}
    
    // $ExpectType "B"
    B.key
    
    class C extends Context.Reference<C>()("C", { defaultValue: () => 0 }) {}
    
    // $ExpectType "C"
    C.key
  • #4397 4dbd170 Thanks @thewilkybarkid! - Make Array.makeBy dual

Don't miss a new effect release

NewReleases is sending notifications on new releases.