github Effect-TS/effect effect@3.17.0

latest releases: @effect/ai-anthropic@0.16.1, @effect/cluster@0.48.3, @effect/workflow@0.9.3...
one month ago

Minor Changes

  • #4949 40c3c87 Thanks @fubhy! - Added Random.fixed to create a version of the Random service with fixed
    values for testing.

  • #4949 ed2c74a Thanks @dmaretskyi! - Add Struct.entries function

  • #4949 073a1b8 Thanks @f15u! - Add Layer.mock

    Creates a mock layer for testing purposes. You can provide a partial
    implementation of the service, and any methods not provided will
    throw an UnimplementedError defect when called.

    import { Context, Effect, Layer } from "effect"
    
    class MyService extends Context.Tag("MyService")<
      MyService,
      {
        one: Effect.Effect<number>
        two(): Effect.Effect<number>
      }
    >() {}
    
    const MyServiceTest = Layer.mock(MyService, {
      two: () => Effect.succeed(2)
    })
  • #4949 f382e99 Thanks @KhraksMamtsov! - Schedule output has been added into CurrentIterationMetadata

  • #4949 e8c7ba5 Thanks @mikearnaldi! - Remove global state index by version, make version mismatch a warning message

  • #4949 7e10415 Thanks @devinjameson! - Array: add findFirstWithIndex function

  • #4949 e9bdece Thanks @vinassefranche! - Add HashMap.countBy

    import { HashMap } from "effect"
    
    const map = HashMap.make([1, "a"], [2, "b"], [3, "c"])
    const result = HashMap.countBy(map, (_v, key) => key % 2 === 1)
    console.log(result) // 2
  • #4949 8d95eb0 Thanks @tim-smart! - add Effect.ensure{Success,Error,Requirements}Type, for constraining Effect types

Don't miss a new effect release

NewReleases is sending notifications on new releases.