createParseTreeStore()
Factory function that creates a ParseTreeStore — a bridge between the @ngaf/partial-json parser and Angular's signal-based Spec rendering. It materializes the parse tree into a Spec signal with structural sharing on each push.
Import:
Signature
| Parameter | Type | Description |
|---|---|---|
parser | PartialJsonParser | A parser instance from createPartialJsonParser() in @ngaf/partial-json |
Returns: ParseTreeStore — must be called within an Angular injection context.
ParseTreeStore Interface
ElementAccumulationState
Usage
Structural sharing
The spec signal uses structural sharing. When a new token updates one element, sibling elements keep the same object reference. Angular's computed() with Object.is equality skips re-evaluation for unchanged elements.