type-alias / @typed/template

Renderable.ServicesFromObject

Traverse all keys in an object and extract the services from each value. If the value is a function, extract the services from the return type of the function.

Package version
1.0.0-beta.13
Category
Renderable requirements
Since
1.0.0
Member of
Renderable

Import

import { Renderable } from "@typed/template";

Access Renderable.ServicesFromObject through the imported Renderable export. Its declaration below describes the member.

Signatures

type ServicesFromObject<T> = [
    {
        [K in keyof T]-?: T[K] extends (...args: Array<any>) => any ? FunctionServices<ReturnType<T[K]>> : Services<T[K]>;
    }[keyof T]
] extends [
    infer U
] ? U : never;

Why

Spread, data, and property objects may contain nested Effect producers whose requirements must remain visible in the enclosing template.

Ownership and lifetime

This compile-time traversal acquires no service.

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source