function / @typed/ui/index

Composite.activeDescendant

Derives activeId only under virtual focus, otherwise undefined.

Learn this UI primitive →

Package version
1.0.0-beta.13
Category
Keyboard focus
Since
1.0.0
Member of
Composite

Import

import { Composite } from "@typed/ui/index";

Access Composite.activeDescendant through the imported Composite export. Its declaration below describes the member.

This public exposure is a re-export. Its import path is supported; declaration documentation is shared with the other public exposures below.

Signatures

export declare function activeDescendant<CompositeState extends State, E, R>(state: RefSubject.RefSubject<CompositeState, E, R>): RefSubject.Computed<string | undefined, E, R>;

Why

The operation exposes Composite’s transition directly so callers can compose it in Effect programs and native event handlers.

Ownership and lifetime

Creating the Computed value acquires nothing eagerly. The Scope that subscribes to it owns observation of the source RefSubject.

Example

Import with import { activeDescendant } from "@typed/ui/Composite"; Extend the Composite.makeState runnable setup. Inside the linked Effect program read const id = yield* activeDescendant(state); it is the active id only under virtual focus and otherwise undefined.

Other public imports

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

Source