Skip to content

Commit

Permalink
doc: Wording
Browse files Browse the repository at this point in the history
  • Loading branch information
franky47 committed Oct 30, 2024
1 parent 21eed2b commit 0a428a8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/docs/content/docs/utilities.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ to shorter keys in the URL:
```ts
const serialize = createSerializer(
{
// Use variable names that make sense for your domain/business logic
// 1. Use variable names that make sense for your domain/business logic
latitude: parseAsFloat,
longitude: parseAsFloat,
zoomLevel: parseAsInteger
},
{
// And remap them to shorter keys in the URL
// 2. Remap them to shorter keys in the URL
urlKeys: {
latitude: 'lat',
longitude: 'lng',
Expand All @@ -86,6 +86,8 @@ const serialize = createSerializer(
}
)

// 3. Use your variable names when calling the serializer,
// and the shorter keys will be rendered in the URL:
serialize({
latitude: 45.18,
longitude: 5.72,
Expand Down

0 comments on commit 0a428a8

Please sign in to comment.