Optionalproperties: TurboObserverProperties<DataType, ComponentType, DataKeyType> = {}Initialization options and lifecycle callbacks.
Create a TurboObserver.
By default, onUpdated updates the data of the mapped instance if it exposes a TurboModel model,
or data / dataId fields. onDeleted removes the instance from the map and the DOM.
Protected_ReadonlyonReadonlyonReadonlyonReadonlyonReadonlyonProtected ReadonlynestedWhether the observer has been initialized (i.e. initialize has been called).
FunctionkeyChanged
The key path that changed.
The new value at that path.
Optionaldeleted: boolean = falseWhether the entry was deleted.
Functionget
Ordered path from outermost to innermost key.
The stored value, or undefined if not found.
FunctiongetFlat
A flat key produced by flattenKey.
The stored value, or undefined if not found.
FunctiongetKey
The value to locate.
The key path, or undefined if not found.
FunctiongetKeys
The value to locate.
Array of key paths.
FunctiongetFlatKey
The value to query.
The flat key, or undefined if not found.
Functionset
The value to store.
Ordered path from outermost to innermost key.
FunctionsetFlat
The value to store.
A flat key produced by flattenKey.
Functionhas
Ordered path from outermost to innermost key.
FunctionhasFlat
A flat key produced by flattenKey.
FunctiongetEntriesAt
Path to the subtree root.
FunctiongetValuesAt
Path to the parent node.
FunctiongetPathsAt
Path to the subtree root.
FunctionflattenKey
The key path to serialize.
The flat key, or undefined if the path is invalid.
FunctionscopeKey
The flat key to convert.
The key path, or undefined if conversion fails.
Convert a flat key back into a key path. Reverses flattenKey.
"k0|k1|k2" becomes [k0, k1, k2].ProtectedfindOptionaltarget: ComponentTypeProtectedget
TurboObserver
Description
Generic observer that keeps a set of component instances organized by key path. Useful to maintain UI components or other per-entry objects synchronized with a data source (TurboModel).
Template: KeyType
The key type used at each level of the path.