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 Parameter | Default type | Description |
|---|---|---|
T | unknown | the type of value it carries |
Methods
decode()
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
| Parameter | Type |
|---|---|
encoded | JsonValue |
Returns
T
encode()
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
| Parameter | Type |
|---|---|
value | unknown |
Returns
JsonValue | undefined