Skip to content

Commit

Permalink
useFetch: Fix mapResult being required when not using paginated o…
Browse files Browse the repository at this point in the history
…verload.
  • Loading branch information
sxn committed Mar 18, 2024
1 parent 568324c commit 728c8d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions docs/utils-reference/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ npm install --save @raycast/utils
### v1.13.3

- Fixed `optimisticUpdate` not working when paginating beyond the first page when using `useCachedPromise` or other hooks that build on top of it..
- Fixed `useFetch` type requiring `mapResult` for non-paginated overload.

### v1.13.2

Expand All @@ -34,12 +35,12 @@ npm install --save @raycast/utils

### v1.12.5

- Added string array support for OAuth scope (Thanks @tonka3000!).
- Add string array support for OAuth scope (Thanks @tonka3000!).

### v1.12.4

- Added `tokenResponseParser` and `tokenRefreshResponseParser` in the options of `OAuthService`.
- Fixed built-in Slack OAuthServices.
- Add `tokenResponseParser` and `tokenRefreshResponseParser` in the options of `OAuthService`.
- Fix built-in Slack OAuthServices.

### v1.12.3

Expand Down
2 changes: 1 addition & 1 deletion src/useFetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export function useFetch<V = unknown, U = undefined, T extends unknown[] = unkno
export function useFetch<V = unknown, U = undefined, T = V>(
url: RequestInfo,
options?: RequestInit & {
mapResult: (result: V) => { data: T; hasMore?: boolean };
mapResult?: (result: V) => { data: T; hasMore?: boolean };
parseResponse?: (response: Response) => Promise<V>;
} & Omit<CachedPromiseOptions<(url: RequestInfo, options?: RequestInit) => Promise<T>, U>, "abortable">,
): UseCachedPromiseReturnType<T, U> & { pagination: undefined };
Expand Down

0 comments on commit 728c8d2

Please sign in to comment.