From b023962a1184bbb185299cd335fce3ad5652848b Mon Sep 17 00:00:00 2001 From: Andrew Chou Date: Tue, 7 Apr 2026 14:15:53 -0400 Subject: [PATCH] chore: update docs for useMapStyleUrl() --- docs/API.md | 19 +------------------ src/hooks/maps.ts | 16 +--------------- 2 files changed, 2 insertions(+), 33 deletions(-) diff --git a/docs/API.md b/docs/API.md index 0254ab5..0e3c136 100644 --- a/docs/API.md +++ b/docs/API.md @@ -1111,34 +1111,17 @@ Parameters: Get a URL that points to a StyleJSON resource served by the embedded HTTP server. -If `opts.refreshToken` is specified, it will be appended to the returned URL as a search param. This is useful for forcing cache busting -due to hidden internal details by consuming components (e.g. map component from MapLibre). - | Function | Type | | ---------- | ---------- | | `useMapStyleUrl` | `() => { data: string; error: Error or null; isRefetching: boolean; }` | -Parameters: - -* `opts.refreshToken`: String to append to the returned value as a search param - - Examples: ```tsx function ExampleWithoutRefreshToken() { const { data, isRefetching } = useMapStyleUrl() - console.log(data) // logs something like 'http://localhost:...' -} -``` - -```tsx -function ExampleWithRefreshToken() { - const [refreshToken] = useState('foo') - const { data } = useMapStyleUrl({ refreshToken }) - - console.log(data) // logs something like 'http://localhost:...?refresh_token=foo' + console.log(data) // logs something like 'http://127.0.0.1:...' } ``` diff --git a/src/hooks/maps.ts b/src/hooks/maps.ts index d28e22a..24679b2 100644 --- a/src/hooks/maps.ts +++ b/src/hooks/maps.ts @@ -37,26 +37,12 @@ import { /** * Get a URL that points to a StyleJSON resource served by the embedded HTTP server. * - * If `opts.refreshToken` is specified, it will be appended to the returned URL as a search param. This is useful for forcing cache busting - * due to hidden internal details by consuming components (e.g. map component from MapLibre). - * - * @param opts.refreshToken String to append to the returned value as a search param - * * @example * ```tsx * function ExampleWithoutRefreshToken() { * const { data, isRefetching } = useMapStyleUrl() * - * console.log(data) // logs something like 'http://localhost:...' - * } - * ``` - * - * ```tsx - * function ExampleWithRefreshToken() { - * const [refreshToken] = useState('foo') - * const { data } = useMapStyleUrl({ refreshToken }) - * - * console.log(data) // logs something like 'http://localhost:...?refresh_token=foo' + * console.log(data) // logs something like 'http://127.0.0.1:...' * } * ``` */