effect-io-ai

Package: effect
Module: Request

Request.Success

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

Example (Extracting a request success type)

import type { Request } from "effect"

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

// Extract the success type from a Request using the utility
type UserSuccess = Request.Success<GetUser> // string

Signature

type Success<T> = [T] extends [Request<infer _A, infer _E, infer _R>] ? _A
  : never

Source

Since v2.0.0