StandardNestedFetcher
Defined in: nested.ts:112, nested.ts:171
A fetcher that returns all nested entries
Key features:
- Tracks nested objects in properties, arrays, sets, and maps
- Iterates every nested object as an StandardNestedFetcher.Entry, carrying its key, its key path and its data
- Narrows iteration to one annotated member with getForKey
- Maintains parent-child relationships
Remarks
Section titled “Remarks”Nothing is cached: every iteration reads the annotated members again and calls transform again, so a derivation
that iterates is re-evaluated whenever any observable read along the way changes.
Symbol keys are not supported, nor are map keys with no key path form, such as objects and booleans.
A key path is the address a nested object is reached by, so two annotated members that resolve to one — as
same-named private members of a parent and a child class do — are rejected at construction.
The contents of a single member can still produce entries that share a key path, such as a map holding both 0
and "0": every one of them is fetched, and iteration yields each one.
Type Parameters
Section titled “Type Parameters”T extends object
Implements
Section titled “Implements”Iterable<StandardNestedFetcher.Entry<T>>
Entry<
T> =object
Defined in: nested.ts:178
Entry representing a nested object
Remarks
Section titled “Remarks”Used when iterating over nested objects to provide context about their location
Type Parameters
Section titled “Type Parameters”T extends object
readonlydata:T
Defined in: nested.ts:184
Data
readonlykey:KeyPath
Defined in: nested.ts:180
Name of the field containing the nested object
keyPath
Section titled “keyPath”
readonlykeyPath:KeyPath
Defined in: nested.ts:182
Full path to the nested object
Constructor
Section titled “Constructor”new StandardNestedFetcher<
T>(target,transform):StandardNestedFetcher<T>
Defined in: nested.ts:123
Parameters
Section titled “Parameters”target
Section titled “target”object
The target object
transform
Section titled “transform”(entry: StandardNestedFetcher.Entry<any>) => T | null
A function that transforms the entry to the desired type.
If the function returns null, the entry is ignored.
It runs during iteration, so the observables it reads are tracked by whatever derivation iterates —
which is what lets it filter entries reactively, and what makes a wide-reading transform re-run often.
Returns
Section titled “Returns”StandardNestedFetcher<T>
Members
Section titled “Members”[iterator]()
Section titled “[iterator]()”[iterator]():
Generator<StandardNestedFetcher.Entry<T>,void,unknown>
Defined in: nested.ts:153
Iterate over all entries
Returns
Section titled “Returns”Generator<StandardNestedFetcher.Entry<T>, void, unknown>
Implementation of
Section titled “Implementation of”Iterable.[iterator]
getForKey()
Section titled “getForKey()”getForKey(
keyPath):Generator<StandardNestedFetcher.Entry<T>,void,unknown>
Defined in: nested.ts:162
Iterate over all entries for the given key path
Parameters
Section titled “Parameters”keyPath
Section titled “keyPath”Returns
Section titled “Returns”Generator<StandardNestedFetcher.Entry<T>, void, unknown>