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:84

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:79

Encodes value as plain JSON data when it is a value this transporter carries. For any other value it answers with a falsy value, and the next transporter is asked, so an encoding is never falsy itself. When it throws, dehydrate lists that resolve in unserializable.

Parameters ​

ParameterType
valueunknown

Returns ​

JsonValue | undefined