@@ -40,19 +40,31 @@ export function useSeamInfiniteQuery<
4040 initialPageParam : null ,
4141 getNextPageParam : ( lastPage ) => lastPage . nextPageCursor ,
4242 queryFn : async ( { pageParam } ) => {
43- if ( client == null ) return { data : [ ] as Awaited < ReturnType < SeamHttpEndpoints [ T ] > > , nextPageCursor : null }
43+ if ( client == null )
44+ return {
45+ data : [ ] as Awaited < ReturnType < SeamHttpEndpoints [ T ] > > ,
46+ nextPageCursor : null ,
47+ }
4448 // Using @ts -expect-error over any is preferred, but not possible here because TypeScript will run out of memory.
4549 // Type assertion is needed here for performance reasons. The types are correct at runtime.
4650 const endpoint = client [ endpointPath ] as ( ...args : any ) => any
4751 const request = endpoint ( parameters , options )
4852 const pages = client . createPaginator ( request )
4953 if ( pageParam == null ) {
5054 const [ data , { nextPageCursor } ] = await pages . firstPage ( )
51- return { data : data as Awaited < ReturnType < SeamHttpEndpoints [ T ] > > , nextPageCursor }
55+ return {
56+ data : data as Awaited < ReturnType < SeamHttpEndpoints [ T ] > > ,
57+ nextPageCursor,
58+ }
5259 }
5360 // Type assertion is needed for pageParam since the Seam API expects a branded PageCursor type.
54- const [ data , { nextPageCursor } ] = await pages . nextPage ( pageParam as SeamPageCursor )
55- return { data : data as Awaited < ReturnType < SeamHttpEndpoints [ T ] > > , nextPageCursor }
61+ const [ data , { nextPageCursor } ] = await pages . nextPage (
62+ pageParam as SeamPageCursor
63+ )
64+ return {
65+ data : data as Awaited < ReturnType < SeamHttpEndpoints [ T ] > > ,
66+ nextPageCursor,
67+ }
5668 } ,
5769 } )
5870}
0 commit comments