effect-io-ai

Package: effect
Module: Request

Request.Result

A utility type to extract the result type from a Request.

Example (Extracting a request result type)

import type { Request } from "effect"

interface GetUser extends Request.Request<string, Error> {
  readonly _tag: "GetUser"
  readonly id: number
}

// Extract the result type from a Request using the utility
type UserResult = Request.Result<GetUser> // Exit.Exit<string, Error>

Signature

type Result<T> = T extends Request<infer A, infer E, infer _R> ? Exit.Exit<A, E>
  : never

Source

Since v2.0.0