Skip to content

lit-ui-router-ssr / client / readResolvePayload

Function: readResolvePayload() ​

ts
function readResolvePayload(container): 
  | ResolvePayload
  | undefined;

Defined in: packages/lit-ui-router-ssr/src/client.ts:633

Reads the resolve payload prerender() wrote into the container's hydration signature: the state and url parameters the document was drawn for, and the values its resolves settled on, keyed by state name, then by resolve token.

bootstrap reads it on its own. A boot that calls hydrateRoot directly hands it to seed from ui-router-server/ssr/client before the router starts.

Parameters ​

ParameterTypeDescription
containerParentNodethe element the server's markup was written into

Returns ​

| ResolvePayload | undefined

the payload, or undefined when the container holds no signature, one from another release line of this package, or one without resolves

Example ​

ts
import { readResolvePayload } from 'lit-ui-router-ssr/client';
import { seed } from 'ui-router-server/ssr/client';

seed(router, readResolvePayload(root));
router.start();