File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
docs/start/framework/solid/guide Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -7,3 +7,28 @@ replace:
77 ' @tanstack/react-router ' : ' @tanstack/solid-router' ,
88 }
99---
10+
11+ ### Custom serialization adapters
12+
13+ You can create custom serialization adapters to handle complex types that can't be serialized by default.
14+
15+ Example:
16+
17+ ``` ts
18+ // src/start.ts
19+ import { createStart } from ' @tanstack/solid-start'
20+ import { createSerializationAdapter } from ' @tanstack/solid-router'
21+
22+ const bigIntAdapter = createSerializationAdapter ({
23+ key: ' bigint' ,
24+ test : (value : unknown ): value is bigint => typeof value === ' bigint' ,
25+ toSerializable : (bigInt ) => bigInt .toString (),
26+ fromSerializable : (value ) => BigInt (value ),
27+ })
28+
29+ export const startInstance = createStart (() => {
30+ return {
31+ serializationAdapters: [bigIntAdapter ],
32+ }
33+ })
34+ ```
You can’t perform that action at this time.
0 commit comments