Services<T>Extracts the service requirements (RIn) from a Layer type.
When to use
Use to derive the dependency requirements of a generic or inferred Layer
without restating its RIn type parameter.
export type type Services<T extends Any> =
T extends infer L
? L extends Layer<
infer _ROut,
infer _E,
infer _RIn
>
? _RIn
: never
: never
Extracts the service requirements (RIn) from a Layer type.
When to use
Use to derive the dependency requirements of a generic or inferred Layer
without restating its RIn type parameter.
Services<function (type parameter) T in type Services<T extends Any>T extends Any> = function (type parameter) T in type Services<T extends Any>T extends infer function (type parameter) LL
? function (type parameter) LL extends interface Layer<in ROut, out E = never, out RIn = never>A Layer describes how to build one or more services for dependency injection.
When to use
Use to model construction of application services for dependency injection,
especially when services have dependencies, can fail during construction, or
need scoped setup and release.
Details
A Layer<ROut, E, RIn> represents ROut as the services this layer
provides, E as the possible errors during layer construction, and RIn as
the services this layer requires as dependencies.
Layer<infer function (type parameter) _ROut_ROut, infer function (type parameter) _E_E, infer function (type parameter) _RIn_RIn> ? function (type parameter) _RIn_RIn : never
: never