getOrInitRootChaynsHistoryLayer
Callable
Parameters
optionalurl: string
On SSR, pass the current request URL (e.g.
req.urlorrouter.asPath) so child layers receive the correct initial route segments. Ignored after first call.optionalsegmentCount: number
Number of URL segments the root layer owns. When provided the segments are resolved from the URL immediately so
getRoute()is populated on the very first render without any subsequentsetSegmentCountcall. Ignored after first call.
Returns InitRootChaynsHistoryLayerResult
Returns the singleton root ChaynsHistoryLayer for the current window. Creates it on first call; subsequent calls return the same instance.