createParseTreeStore()
Factory function that creates a ParseTreeStore โ a bridge between the @cacheplane/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 @cacheplane/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.