Skip to content

ui-router-server / ssr / Transporter

Interface: Transporter<T> ​

Defined in: resolve-payload.ts:71

Carries one type of value that plain JSON data can't, such as a Date, through the payload. dehydrate from ui-router-server/ssr and seed from ui-router-server/ssr/client take a record of them, keyed by a name both sides share.

Type Parameters ​

Type ParameterDefault typeDescription
Tunknownthe type of value it carries

Methods ​

decode() ​

ts
decode(encoded): T;

Defined in: resolve-payload.ts:85

Rebuilds the value from what encode returned, after a JSON round trip. When it throws, seed adopts nothing for that resolve.

Parameters ​

ParameterType
encodedJsonValue

Returns ​

T


encode() ​

ts
encode(value): JsonValue | undefined;

Defined in: resolve-payload.ts:80

Encodes value as plain JSON data when it is a value this transporter carries. For any other value it answers with false, null or undefined, and the next transporter is asked, so an encoding of false or null must be wrapped, as in [false]; 0 and "" are encodings. When it throws, dehydrate lists that resolve in unserializable.

Parameters ​

ParameterType
valueunknown

Returns ​

JsonValue | undefined