Request<any, any, any>Prototype used by Effect's request constructors.
Details
This low-level value provides the structural request marker for values
created by Request.of, Request.tagged, Request.Class, and
Request.TaggedClass. Most users should use those constructors instead of
interacting with the prototype directly.
export const const RequestPrototype: Request<
any,
any,
any
>
Prototype used by Effect's request constructors.
Details
This low-level value provides the structural request marker for values
created by Request.of, Request.tagged, Request.Class, and
Request.TaggedClass. Most users should use those constructors instead of
interacting with the prototype directly.
RequestPrototype: interface Request<out A, out E = never, out R = never>A Request<A, E, R> is a request from a data source for a value of type A
that may fail with an E and have requirements of type R.
Example (Defining typed requests)
import type { Request } from "effect"
// Define a request that fetches a user by ID
interface GetUser extends Request.Request<string, Error> {
readonly _tag: "GetUser"
readonly id: number
}
// Define a request that fetches all users
interface GetAllUsers extends Request.Request<ReadonlyArray<string>, Error> {
readonly _tag: "GetAllUsers"
}
Request<any, any, any> = {
...import corecore.const StructuralProto: {
[x: number]:
| ((this: any) => number)
| ((this: any, that: any) => boolean)
}
StructuralProto,
[const TypeId: "~effect/Request"TypeId]: const requestVariance: anyconst requestVariance: {
_E: (_: never) => never;
_A: (_: never) => never;
_R: (_: never) => never;
}
requestVariance
}